Jon,
You can apply regex in tiddlywiki, so perhaps you can use your notpad++
method?
I will suggest once again (forcefully) if you want a global solution, then
convert dates to the system date format then you can use $view date to
display any format, including the relative date.
If your input date is 20/06/07 and its the title of a tiddler, try this on
tiddlywiki.com
\define cc-date(date) 20$date$
\define date-yy-mm-dd(date) <$text text={{{
[[20$date$]split[/]join[]addsuffix[120000000]]
}}}/>
:redate <<cc-date "20/06/07">> quick reformat for appearance
:<$macrocall $name=cc-date date={{!!title}}/> using title/field or variable
:<<date-yy-mm-dd "20/06/07">> reformat to serial date, also set to 12 noon
<$wikify name=journal-date text="""<$macrocall $name=date-yy-mm-dd
date={{!!title}}/>""" output=text>
<$button>
<$action-setfield $field=journal-date $value=<<journal-date>>/>
set journal date
</$button>
</$wikify>
journal-date=<$view field=journal-date format=date template="YYYY/0MM/0DD"/>
or <$view field=journal-date format=relativedate/>
Regards
Tony
On Tuesday, June 9, 2020 at 2:50:55 AM UTC+10, Jon wrote:
>
> Hi Hubert,
>
> Thanks for this, which I'll be able to use down the line but at the
> moment, I wouldn't know how to apply this globally.
>
> However, I've managed to find a solution using a text editor like Notepad
> ++. Instructions below for anyone else looking for this.
>
> So, to convert 18/09/10 to 2018-09-10
>
> Select 'Regular expression' in Search Mode
>
> 'Find what' ([0-9]{2})/+([0-9]{2})/+([0-9]{2})
>
> 'Replace with' 20\1-\2-\3
>
> there's a bit more info. here
> <https://stackoverflow.com/questions/4331138/find-and-replace-with-reordered-date-format-in-notepad>
>
> Thanks
> Jon
>
> On Monday, 8 June 2020 16:22:00 UTC+1, Hubert wrote:
>>
>> Hi Jon,
>>
>> You can use this ugly macro below to "convert" any string like this:
>> "20/06/07" into this: "2020/06/07", assuming that the earliest year in your
>> range is the year 2000.
>>
>> Paste this macro definition in a new tiddler:
>>
>> \define UpdateDate(date)
>> <$vars
>> y={{{ [<__date__>split[/]nth[1]add[2000]] }}}
>> m={{{ [<__date__>split[/]nth[2]] }}}
>> d={{{ [<__date__>split[/]nth[3]] }}}>
>> <<y>>/<<m>>/<<d>>
>> </$vars>
>> \end
>>
>> And then below that, put your input dates in the macro like this:
>>
>> <<UpdateDate 20/06/07>>
>>
>> When you save the tiddler the output will be rendered to this: 2020/06/07
>>
>> You can wrap this macro in a filter to change all dates in one go and
>> then simply copy/paste the output.
>>
>> The whole operation would probably be quicker and simpler using a text
>> editor as these are just strings, not to mention that the above macro can
>> probably be simplified to a one-liner. Anyway, just something quick.
>>
>> Regards,
>> Hubert
>>
>
--
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/df36a5d1-e91f-4502-8912-de92df6d8ef2o%40googlegroups.com.