Please see this post 
<https://groups.google.com/d/msg/tiddlywiki/qv02EnGUwU8/kJzZESJFBAAJ> for 
explanation and examples. The patch mentioned there has been merged so 
everything should work as described.

On Saturday, September 8, 2018 at 1:48:33 AM UTC-7, TonyM wrote:
>
> Folks,
>
> Since the title of this Post may attract people looking for the  Days 
> Operator and Examples (documentation addition)
> and since I have not had any reply's so far I have gone ahead and 
> researched this. I have attached a tiddler I used to understand the days 
> operator for anyone interested.
>
> To be honest this days operator may have some advantages in some coding 
> cases, and it provides the features we need it really confuses the user. *But 
> I expect that why I got no replies is because almost no one understands it.*
>
> I will prepare a more refined set of examples and documentation however it 
> will be quite tricky. Here are some conceptual ideas to keep in mind if you 
> want to use it yourself. 
>
> *This is my conclusion but needs independent verification.*
>
> When using the days parameter the number N in days[N] and days[-N] is 
> always a date relative to today (Negative in the past, and Positive in the 
> future) and today is always important.
> You can specify a field other than modified with days:fieldname[N]. The 
> meaning of N never changes It is the point around which you are looking for 
> dates.
>
> *Let us call the date referenced by the number a "Reference date", and 
> they are relative to today*
>
> Now the Positive form of the days operator is "days[n]" and the negative  
> form "!days[N]"
>
> First Using Zero for N
> If N = 0 days[0] in the positive form means all days in the past and 
> future for the nominated date field.
> If N = 0 !days[0] in the negative form means NO days in the past or future 
> for the nominated date field. Always no days at all.
>
> *The Positive or negative forms can be considered as *
>
>    - Positive includes today *The positive form means always include 
>    today in the result*
>    - Negative does not include today *The negative form means do not 
>    include today in the result*
>
> *Basically if you have today and a reference date say 7 or -7 days from 
> now then (regardless of whether the reference date is + or -);*
>
>    - The positive form will give you all days from the reference date, 
> *including 
>    today *so it will be all dates before the reference date (into the 
>    past)
>    - The negative form will give you all days from the reference date, *Not 
>    including today* for it will be all dates after the reference date 
>    (into the future)
>
> *If you want all days in the future of a given date*
> *it all depends on when today is*
>
> For Future reference dates Use the days operator !days[+N]
> For Past reference dates Use the days operator days[-N]
>
> *If you want all days in the past of a given date*
> *it all depends on when today is*
>
> For Future reference dates Use the days operator days[+N]
> For Past reference dates Use the days operator !days[-N]
>
> Remember ! is like Not, and Not including today
>
>
> *Using a range of dates, using the same date field and two days operators*
>
> *Use the convention of the past date first and future date second *
> days[-7]days[+7]
>
>    - Use the positive or negative version of the days operator *but do 
>    NOT Mix them*
>    *to mix them will either mean one is not necessary or the result is 
>    null*
>    - The Positive (on both days operators) version will be the dates 
>    *between* the two reference dates. 
>    - The Negative (on both days operators) version will be the dates 
>    *Outside* the two reference dates. 
>
> Regards
> Tony
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/4a0acb91-cde9-4967-9585-2c82c89e1140%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to