Post Script;

I believe this proposed validatedate operator would would unlock the 
possibility of a lot of date handling without the inclusion of more complex 
date handling plugins etc...

Just to explain a little further using nested range operators it would be 
possible to generate any number of years, months and days such as from 1 to 
31 days and have the proposed validate eliminate invalid dates. This would 
be good for producing date tiddlers or rejecting invalid date entries eg
[{date}is[validdate]]" emptyMessage="Invalid date"


   - Then the valid date(s) can be used to test for the existence or list 
   tiddlers.
   - One could even use a generated list of valid dates to do relative 
   dates such as +45 days later using the set widget index parameter

The inability to format a variable as a date is still a restriction

Regards
Tony

On Wednesday, March 4, 2020 at 10:25:11 AM UTC+11, TonyM wrote:
>
> Folks,
>
> In this thread 
> <https://groups.google.com/forum/?hl=en#!topic/tiddlywiki/kNJFU8w9Q_I> 
> David asks how to generate a range of dates. 
>
> This made me ask myself what if we had an operator that given a date input 
> of the standard TiddlyWiki form YYYYMMDD+ 
> it was able to filter out invalid dates according to calendar rules
>
> That is if 20200229 or 20200229231215828  is filtered eg "is[validdate]" 
> it would be passed through as there is a 29th of february this year.
> That is if 20210229 or 20210229231215828 would not be because there is no 
> leap year in 2021
>
> This may be a simple javascript date function already available in 
> tiddlywiki.
>
> It would then become possible to do the following;
>
> <$list filter="[range[1,31]addprefix[202002]is[validdate]]">
>
> </$list>
> to generate a list of February 2020 valid days of the month
> *I have not complicated the above with the need to zero fill the range 
> value*
>
> From this proposed filter it would be very easy to generate date ranges or 
> test any YYYMMDD for validity
>
> This could as easily extend to time as well if required is[validtime] 
> HHMMSS
>
> What do you think?
> Can someone help me make this so?
>
> Regards
> Tony
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/72cc6675-667d-49e6-8552-d98906e48e7a%40googlegroups.com.

Reply via email to