I have some lazy users they are requested to enter some dates in a tiddler field! They enter dates in different and sometimes ugly mixed format! like
- 2021.09.5
- 2021-09-05
- 2021 09 05
- 2021/09/05
- 2021 - 09.5
- 2021/ 09/ 05
But always they follow year, month and day.
TW has to read all this ugly dates and show them in a nicely format! I want to know what is the simple and TW good programming style
One solution
\define dispdate()
<$list filter="[<currentTiddler>split[.]trim[]join[]split[-]trim[]join[]split[ ]trim[]join[]split[/]trim[]join[]] ">
<li><<currentTiddler>> gives
<$view field=title format=date template="YYYY-0MM-0DD"/>
</li>
</$list>
\end
<$tiddler tiddler="2011 -09 - 24">
<<dispdate>>
</$tiddler>
Reproduce
- open https://tiddlywiki.com
- create a new tiddler
- paste above code as tiddler body
- change
tiddler="2011 -09 - 24"
to any data and mixed format