[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/79344627-e3b3-4b8a-a9d7-8d6bf84f3843n%40googlegroups.com.

Reply via email to