Folks, As continues in the thread the inability to format a variable as a date is still a restriction.
I add it here because if the Original thread request can be satisfied by a simple widget clone and modify, perhaps this can use a similar mechanism. The View widget only operates on text references so you first have to store dates. My proposal to allow variable input was rejected as overloading the view widget. *But this remains a serious gap for simple date manipulation and assumes standard date fields are all we use.* If the view widget can not accept dates could we have a simple date-format widget <$date-format date=<<variablename>> template="DDD DDth MMM YYYY"/> <$date-format date=<<variablename>> format=relativedate"/> The above would also accept text references, no output and perhaps an emptyMessage could be triggered for an invalid date. 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/f0a344a9-1e69-4014-8861-09c1ff90964f%40googlegroups.com.
