mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-09-19 00:00:43 +00:00
"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
This commit is contained in:
committed by
Jeremy Ruston
parent
c33e83f595
commit
19ee5bcf4e
@@ -27,6 +27,7 @@ exports.days = function(source,operator,options) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if(operator.prefix === "!") {
|
if(operator.prefix === "!") {
|
||||||
|
targetTimeStamp = targetTimeStamp - 1000*60*60*24*dayIntervalSign;
|
||||||
source(function(tiddler,title) {
|
source(function(tiddler,title) {
|
||||||
if(tiddler && tiddler.fields[fieldName]) {
|
if(tiddler && tiddler.fields[fieldName]) {
|
||||||
if(!isWithinDays($tw.utils.parseDate(tiddler.fields[fieldName]))) {
|
if(!isWithinDays($tw.utils.parseDate(tiddler.fields[fieldName]))) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: days Operator
|
|||||||
type: text/vnd.tiddlywiki
|
type: text/vnd.tiddlywiki
|
||||||
caption: days
|
caption: days
|
||||||
op-input: a [[selection of titles|Title Selection]]
|
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-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: a number of days, defaulting to 0
|
||||||
op-parameter-name: D
|
op-parameter-name: D
|
||||||
|
|||||||
Reference in New Issue
Block a user