title: $:/plugins/linonetwo/date-filters/readme
type: text/vnd.tiddlywiki

\define lingo-base() $:/plugins/linonetwo/date-filters/language/

! date-filters

Filters for getting week range and preparing visualization data.

// TODO: use https://talk.tiddlywiki.org/t/introducing-the-testcase-widget/9847/19 after 5.3.4 release

!! Macros

<$macrocall $name=".example" n="m1" eg="""<<weekstart>>"""/>

<$macrocall $name=".example" n="m2" eg="""<<weekend>>"""/>

<$macrocall $name=".example" n="m3" eg="""<<montosun>>"""/>

!! Filter Operators

<<.operator-example f1 "[[CountUpDayExampleTiddler]daysbetween[]]">>

<<.operator-example f1.5 "[[CountUpDayExampleTiddler]hoursbetween[]]">>

<<.operator-example f2 "[weekstart[]]">>

<<.operator-example f2.5 "[<weekstart>]">>

<<.operator-example f3 "[weekend[]]">>

<<.operator-example f3.5 "[<weekend>] [<now [UTC]YYYY0MM0DD0hh0mm0ssXXX>]">>

<<.operator-example f4 "[all[tiddlers]!is[system]field:calendarEntry[yes]tag[Sleeping]]">>

<<.operator-example f4.1 "[all[tiddlers]!is[system]field:calendarEntry[yes]tag[Sleeping]] :filter[get[startDate]compare:date:gteq<weekstart>compare:date:lteq<now [UTC]YYYY0MM0DD0hh0mm0ssXXX>]">>

<<.operator-example f4.2 "[all[tiddlers]!is[system]field:calendarEntry[yes]tag[Sleeping]] :filter[get[startDate]compare:date:gteq<weekstart>compare:date:lteq<now [UTC]YYYY0MM0DD0hh0mm0ssXXX>] +[counthours[]]">>

<<.operator-example f5 "[daystart[0],[7]] [dayend[0],[7]]">>

<<.operator-example f6 "[weekstart[]addweekday[]] [weekstart[]addweekday[4]]">>

<<.operator-example f7 "[all[tiddlers]!is[system]field:calendarEntry[yes]tagsfreq[7]]">>

<<.operator-example f7.1 "[all[tiddlers]!is[system]field:calendarEntry[yes]tagsfreq[14]first[5]]">>
