[TW5] Timeline macro should not assume 1900 as century

98 views
Skip to first unread message

Mat

unread,
Jul 28, 2015, 10:30:04 AM7/28/15
to TiddlyWiki
Might the timeline macro contain a bug or merely a missed out specification?

In timelining by field "recent" that has dates on the format 15/07/28, what gets displayed is a timeline showing the year as 1915!


<$macrocall $name="timeline" format={{$:/language/RecentChanges/DateFormat}} subfilter="has[recent]" dateField="recent"/>


While the implications for this are staggering (time travel!) I'm a bit conservative and would like it to show 2015 instead.

Please help

<:-)





Jeremy Ruston

unread,
Jul 28, 2015, 10:43:23 AM7/28/15
to TiddlyWiki
Hi Mat

TiddlyWiki5 requires date fields to be in the format described here:


It's kind of a bug that the wrong date format half works. I think that what is actually happening is that the conversion code extracts "15/0" as the year, which is then converted to 15 when it is converted to a number. When that is turned into a year, JavaScript still defaults to the 20th century (probably because two digit years have rather fallen out of use since the millenium).

Best wishes

Jeremy.




--
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 tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/3e26f506-95d1-458e-a193-f417aec495fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Mat

unread,
Jul 28, 2015, 2:30:06 PM7/28/15
to TiddlyWiki, jeremy...@gmail.com
Thanks for your reply Jeremy!


TiddlyWiki5 requires date fields to be in the format described here:
http://tiddlywiki.com/#Date%20Fields


Hm, that tiddler refers to tiddler DateFormat where the simple YY is explicitly stated as a token. Albeit for the ViewWidget, but the name of the tiddler does imply more generality. It is a bit unfortunate if widgets have different restrictions on this. Should I post an issue on this?


@anyone
I have for TWaddles timeline in tab Recent added the date in format YY/MM/DD in a field to quite a few tiddlers. Does anybody have a good idea how to best get this to work properly?

Thanks!

<:-)

Jeremy Ruston

unread,
Jul 28, 2015, 2:59:00 PM7/28/15
to Mat, TiddlyWiki
Hi Mat

Hm, that tiddler refers to tiddler DateFormat where the simple YY is explicitly stated as a token. Albeit for the ViewWidget, but the name of the tiddler does imply more generality. It is a bit unfortunate if widgets have different restrictions on this. Should I post an issue on this?

Ah, the DateFormat tiddler is about the formatting strings for controlling the *outputting* of dates. I'm not sure that I can clarify the docs; the explanation is pretty clear that it's about the <$view> widget. Any suggestions?

Best wishes

Jeremy.



 


@anyone
I have for TWaddles timeline in tab Recent added the date in format YY/MM/DD in a field to quite a few tiddlers. Does anybody have a good idea how to best get this to work properly?

Thanks!

<:-)

Mat

unread,
Jul 28, 2015, 4:57:10 PM7/28/15
to TiddlyWiki, jeremy...@gmail.com
On Tuesday, July 28, 2015 at 8:59:00 PM UTC+2, Jeremy Ruston wrote:
Hi Mat

Hm, that tiddler refers to tiddler DateFormat where the simple YY is explicitly stated as a token. Albeit for the ViewWidget, but the name of the tiddler does imply more generality. It is a bit unfortunate if widgets have different restrictions on this. Should I post an issue on this?

Ah, the DateFormat tiddler is about the formatting strings for controlling the *outputting* of dates. I'm not sure that I can clarify the docs; the explanation is pretty clear that it's about the <$view> widget. Any suggestions?


Ok, for clarifying the docs; it's one of those things that once you know about it then you know about it, but previous to this it is easy to quickly scan the page and thing you "got it" without having actually noticed that the lines before what appears to be the important stuff are a pre-requisite to interpret that stuff the right way. I guess a title like "ViewWidget DateFormats" would be clearer in this regard. No real biggie, but since you asked.


BTW, there's a monthly typo in the example at bottom stating 

DDth MMM \M\M\M YYYY16th February MMM 2011


<:-)

Jeremy Ruston

unread,
Jul 31, 2015, 3:57:21 AM7/31/15
to Mat, TiddlyWiki
Hi Mat

Ok, for clarifying the docs; it's one of those things that once you know about it then you know about it, but previous to this it is easy to quickly scan the page and thing you "got it" without having actually noticed that the lines before what appears to be the important stuff are a pre-requisite to interpret that stuff the right way. I guess a title like "ViewWidget DateFormats" would be clearer in this regard. No real biggie, but since you asked.

Thanks, I'll have another look.
 
BTW, there's a monthly typo in the example at bottom stating 

DDth MMM \M\M\M YYYY16th February MMM 2011


I'm not sure what you mean - the example is intended to demonstrate how one would introduce a string like "MMM" into the output without it being interpreted as a substitution.

Best wishes

Jeremy.

 

<:-)
Reply all
Reply to author
Forward
0 new messages