From 19ee5bcf4e952da078156f77505f8bf7c60184f6 Mon Sep 17 00:00:00 2001 From: nameanyone Date: Wed, 27 Apr 2016 09:23:46 -0700 Subject: [PATCH] "days" filter: yesterday and tomorrow edge cases (#2364) * Change the negation logic to address an edge case Make it possible to get an interval ending with yesterday or starting with tomorrow. * "days" filter: adjust documentation --- core/modules/filters/days.js | 1 + editions/tw5.com/tiddlers/filters/days.tid | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/modules/filters/days.js b/core/modules/filters/days.js index 39cd375f7..318d72567 100644 --- a/core/modules/filters/days.js +++ b/core/modules/filters/days.js @@ -27,6 +27,7 @@ exports.days = function(source,operator,options) { }; if(operator.prefix === "!") { + targetTimeStamp = targetTimeStamp - 1000*60*60*24*dayIntervalSign; source(function(tiddler,title) { if(tiddler && tiddler.fields[fieldName]) { if(!isWithinDays($tw.utils.parseDate(tiddler.fields[fieldName]))) { diff --git a/editions/tw5.com/tiddlers/filters/days.tid b/editions/tw5.com/tiddlers/filters/days.tid index 732bb3aab..8ca1b2baf 100644 --- a/editions/tw5.com/tiddlers/filters/days.tid +++ b/editions/tw5.com/tiddlers/filters/days.tid @@ -3,7 +3,7 @@ title: days Operator type: text/vnd.tiddlywiki caption: days op-input: a [[selection of titles|Title Selection]] -op-neg-output: those input tiddlers in which field <<.place F>> is more than <<.place D>> days in the { future | past }, where <<.place D>> is { positive | negative } +op-neg-output: those input tiddlers in which field <<.place F>> is at least <<.place D>> days in the { future | past }, where <<.place D>> is { positive | negative } op-output: those input tiddlers in which field <<.place F>> is <<.place D>> days in the { future | past } or any time { before | after } that, including { past | future }, where <<.place D>> is { positive | negative } op-parameter: a number of days, defaulting to 0 op-parameter-name: D