I have a TW with many tiddlers, each having two fields, date-start and date-end, amongst other of course. Each of these fields contains a date in string format, dd/mm/yyyy. I need to sort by either and so have worked out, far tooooooo late, that I should have enterrred these as UTC dates.
I would like to add new fields to the appropriate tiddlers (not all tiddlers have these fields), so that I add sort-date-start and sort-date-end, having the date-start and date-end field contents in reverse order. I have been going through functions, regex, variables, etc, but am getting more confused.
The algorithm is simple (in programming terms),
for date-start, create sort-date-start and add contents from date-start in reverse order, removing the slash characters. for date-end, similar actions.
One thought I had, after creating the new fields (can’t see how to do that through a script though), use 3 variables, dd, mm and yyyy, to extract the related values and then write a single string yyyymmdd into the receiving field.
Can someone guide me out of this morass?
bobj