diff --git a/core/modules/filters/eachday.js b/core/modules/filters/eachday.js index 9a91bc30b..350830564 100644 --- a/core/modules/filters/eachday.js +++ b/core/modules/filters/eachday.js @@ -17,15 +17,16 @@ Export our filter function */ exports.eachday = function(source,operator,options) { var results = [], - values = []; + values = [], + fieldName = operator.operand || "modified"; // Function to convert a date/time to a date integer var toDate = function(value) { value = (new Date(value)).setHours(0,0,0,0); return value+0; }; source(function(tiddler,title) { - if(tiddler && tiddler.fields[operator.operand]) { - var value = toDate(tiddler.fields[operator.operand]); + if(tiddler && tiddler.fields[fieldName]) { + var value = toDate(tiddler.fields[fieldName]); if(values.indexOf(value) === -1) { values.push(value); results.push(title); diff --git a/editions/tw5.com/tiddlers/filters/eachday.tid b/editions/tw5.com/tiddlers/filters/eachday.tid index b965ff96e..a91857f55 100644 --- a/editions/tw5.com/tiddlers/filters/eachday.tid +++ b/editions/tw5.com/tiddlers/filters/eachday.tid @@ -1,12 +1,12 @@ created: 20140410103123179 -modified: 20150203184456000 +modified: 20150210161620000 tags: [[Filter Operators]] [[Group Operators]] [[Date Operators]] title: eachday Operator type: text/vnd.tiddlywiki caption: eachday op-purpose: select one of each group of input titles by date op-input: a [[selection of titles|Title Selection]] -op-parameter: the name of a [[date field|Date Fields]] +op-parameter: the name of a [[date field|Date Fields]], defaulting to <<.field modified>> op-parameter-name: F op-output: a selection containing the first input title encountered for each distinct value (ignoring times of day) of field <<.place F>>