Instead of building a widget tree, you could just do a JavaScript macro,
couldn't you?

return date.split('-').map(e=>{
//If e.length === 1, return "0"+e;
//Else return e;
}).join('-');


On Aug 24, 2017 08:10, "Stephan Hradek" <[email protected]> wrote:

>
>
> Am Donnerstag, 24. August 2017 12:52:36 UTC+2 schrieb Stephan Hradek:
>>
>> Wouldn't it be easier to fix all the titles?
>>
>
>
> Maybe this will help
>
> \define fixmonth() $(year)$0$(rest)$
> \define fixday() $(year)$$(month)$0$(rest)$
>
> <$list filter="[regexp[^\d\d\d\d-\d\d?-\d\d?\b]] +[sort[]]"/>
>
> --
>
> <$list filter="[regexp[^\d\d\d\d-\d-]]" variable="theWrongOne">
>
> <$list filter="[title<theWrongOne>splitbefore[-]]" variable="year">
>
> <$list filter="[title<theWrongOne>removeprefix<year>]" variable="rest">
>
> <$button>
> <$action-setfield $tiddler=<<theWrongOne>> $field="title" $value=<<
> fixmonth>>/>
> <$action-deletetiddler $tiddler=<<theWrongOne>>/>
> Fix month for <<theWrongOne>>
> </$button>
>
> </$list>
>
> </$list>
>
> </$list>
>
> <$list filter="[regexp[^\d\d\d\d-\d\d-\d\b]]" variable="theWrongOne">
>
> <$list filter="[title<theWrongOne>splitbefore[-]]" variable="year">
>
> <$list filter="[title<theWrongOne>removeprefix<year>splitbefore[-]]"
> variable="month">
>
> <$list filter="[title<theWrongOne>removeprefix<year>removeprefix<month>]"
> variable="rest">
>
> <$button>
> <$action-setfield $tiddler=<<theWrongOne>> $field="title" $value=<<fixday
> >>/>
> <$action-deletetiddler $tiddler=<<theWrongOne>>/>
> Fix day for <<theWrongOne>>
> </$button>
>
> </$list>
>
> </$list>
>
> </$list>
>
> </$list>
>
> Note that you will delete any duplicates with the above approach! So if
> you have a tiddler "2017-1-12 and a tiddler "2017-01-01" you will loose the
> "2017-01-01" and will be left with "2017-1-1" but now named "2017-01-01".
>
> The tiddler above shows one button for each tiddler having one-digit
> months offering you to fix the month.
>
> It does the same for every tiddler haveing 2 digit month and a one digit
> day.
>
> Have fun.
>
> --
> 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 post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/tiddlywiki.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/tiddlywiki/05079cdd-da24-4250-bb7e-8e2fdd70040a%40googlegroups.com
> <https://groups.google.com/d/msgid/tiddlywiki/05079cdd-da24-4250-bb7e-8e2fdd70040a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CAJ1vdSQnwSeCaWtrKi1oY0-8s0y%3DCvGVxgK7O5gKxCZB99odCg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to