ViewWidget date format display:

updating an idea/chart originally by Stephan Hradek 2014, updated 10/2019 
using the current official format list for date format options

Uses a macro based on, demonstrating the default view widget with date 
format template. Could easily be expanded to read variables or incorporate 
other features.

\define datedisp(datefield,dateformat)
<$view field='$datefield$' format="date" template="$dateformat$"/>
\end

1st value– field to be read, if its not the created or modified fields, I 
assume it must be formatted in the standard TW format (see chart below) 2nd 
value– format desired (see chart below), must be in " " marks if you use 
multiple values or separator characters or spaces

<<datedisp ddd>> <<datedisp "hh12:mm:am DD-MM-YYYY">>
as opposed to now macro which takes the current time that the macro is 
involed or refreshed:
<<now ddd>> - <<now "hh12:mm:am DD-MM-YYYY">>

CREATED: Fri - 1:20:am 8-11-2019
MODIFIED: Sat - 5:26:pm 9-11-2019
NOW macro: Mon - 11:12:pm 11-11-2019

created and modified time-stamp fields UTC time-stamp format: 
[UTC]YYYY0MM0DD0hh0mm0ssXXX
this tiddler's created date for use in examples below: 1:20:am 8/11/2019

*(section of the chart)

Token    displays as    Substituted Value
DDD    Friday    Day of week in full
ddd    Fri    Short day of week
DD    8    Day of month
0DD    08    Adds a leading zero
DDth    8th    Adds a suffix

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/b229d04c-ee82-4a89-a6f9-218ed56ccb8a%40googlegroups.com.

Attachment: date format chart.tid
Description: Binary data

Reply via email to