Mark,
yes, Eric's macro is there, tagged as ' $:/tags/Macro'.

I downloaded an emty Wiki - 'published-tw' field will also not be filled.

To use the "Update Publication Dates" button is a workaround but not the 
best solution.

I miss a system '*date*' field, like '*created*' or '*modified*'.
When this field is filled with format "DDth MMM YYYY" than it is a valid 
date of "[UTC]YYYY0MM0DD0hh0mm0ss0XXX" 

BTW: in $:/ControlPanel/Title of new journal tiddlers 
<#%24%3A%2Fconfig%2FNewJournal%2FTitle> is the same format (DDth MMM YYYY) 
defined 

*One solution can be:*
1. Adding a text field (eg 'published')
2. Define, that this field is a date/time field 
3. The value of the 'published' field will be converted to 
"[UTC]YYYY0MM0DD0hh0mm0ss0XXX" 
and is available as system '*date*' field. 

Than it can also be used in TOC like
*<toc-selective-expandable 'Inhalt' 'sortan[date]' >> *

as it is possible for created: 
*<toc-selective-expandable 'Inhalt' 'sortan[created]' >>*

Regards
Stefan

Mark S. schrieb am Dienstag, 17. August 2021 um 01:00:46 UTC+2:

> [image: screenshot-converted-date.png]
>
> On Monday, August 16, 2021 at 3:57:54 PM UTC-7 Mark S. wrote:
>
>>
>> So, did you add Eric's macro to your TW and verify it works? That would 
>> be the first step in trouble-shooting. Remember, after loading the 
>> convertdate macro, you have to save and reload your TW file.
>>
>> It worked for me without problem:
>>
>>
>>
>>
>> On Monday, August 16, 2021 at 12:30:13 PM UTC-7 S² wrote:
>>
>>> Mark, thanks for feedback.
>>>
>>> The added 'published-tw' field is empty - no values:
>>> [image: published-tw.png]
>>>
>>> Mark S. schrieb am Montag, 16. August 2021 um 20:31:28 UTC+2:
>>>
>>>> So what you really need is a filter operator that can do the conversion 
>>>> and be used inside a sortsub operator. @Eric ?
>>>>
>>>> If you're willing to use an "update" button, one solution would be a 
>>>> button that creates "published-tw" (date in TW format) fields for any 
>>>> tiddler that has a "published" field. Then you could have the TOC sort on 
>>>> the published-tw field. You would have to remember to periodically perform 
>>>> the "update" whenever you had data changes. This two-step approach makes 
>>>> certain activities in TW much easier to handle.
>>>>
>>>> So the code to update the field might look like:
>>>>
>>>> <$button>Update Publication Dates
>>>> <$list filter="[has[published]]">
>>>> <$wikify text="""<$macrocall $name=convertdate from={{!!published}} 
>>>> to="[UTC]YYYY0MM0DD0hh0mm0ss0XXX" />""" name=result >
>>>> <$action-setfield $field=published-tw $value=<<result>> />
>>>> </$wikify>
>>>> </$list>
>>>> </$button>
>>>>
>>>> Be sure to make a backup before trying this of course. Also, this 
>>>> assumes that you have the latest version of Eric's converdate macro 
>>>> installed.
>>>>
>>>>
>>>> On Monday, August 16, 2021 at 3:37:26 AM UTC-7 S² wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> thanks for all input and effort.
>>>>> It looks like it is not so easy...
>>>>>
>>>>> As I wrote, I use the text field ‘publish’ to add a date. (date 
>>>>> modified or created will not help me)
>>>>>
>>>>> This date can also be in the future.
>>>>> Format is *T. MMMM JJJJ* - (eg. *7. April 2021* or *13. August 2021*) 
>>>>> – this is the long date in German (like "DDth MMM YYYY")
>>>>>
>>>>> 'published' is also shown in TOC:
>>>>>
>>>>>   [image: TOC.png]
>>>>>
>>>>> Now asked for a way to sort TOC on ‘published’ instead of Tiddler 
>>>>> title.
>>>>>
>>>>> The output should still be "DDth MMM YYYY"
>>>>>
>>>>> Thanks
>>>>> Stefan
>>>>> Eric Shulman schrieb am Montag, 16. August 2021 um 03:12:35 UTC+2:
>>>>>
>>>>>> On Sunday, August 15, 2021 at 4:47:47 PM UTC-7 Mark S. wrote:
>>>>>>
>>>>>>> Just tried 
>>>>>>> <<convertdate from:"7. April 2021" 
>>>>>>> to:"[UTC]YYYY0MM0DD0hh0mm0ss0XXX">>
>>>>>>> and got a hard RSOE ("from" not defined). I think the arguments need 
>>>>>>> to be tweaked in the macro.
>>>>>>>
>>>>>>
>>>>>> OOPS!  I had originally used "date" and "format" as the parameter 
>>>>>> names, but then I decided to change to using "from" and "to".  
>>>>>> Unfortunately, the arguments in the macro function declaration were 
>>>>>> still 
>>>>>> using "date" and "format", but internally, the macro code referenced 
>>>>>> "from" 
>>>>>> and "to" as intended.  I've corrected the arguments in the macro 
>>>>>> function 
>>>>>> declaration and posted an update here:
>>>>>>
>>>>>> https://tiddlytools.com/timer.html#TiddlyTools%2FTime%2FConvertDate
>>>>>>
>>>>>> Thanks,
>>>>>> -e
>>>>>>
>>>>>

-- 
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/38ea0c7a-e504-4ba9-a2e6-d9c908b85df0n%40googlegroups.com.

Reply via email to