Retireve annual events from TiddlyTools Calendar

Hi,

This is in relation to Getting events from TiddlyTools Calendar.

The solution provided by Eric Shulman retrieves evens that are defined with specific dates in the ‘events’ tagged tiddler e.g.

20210314;Daylight Saving Time starts

It does not retrieve annual evens e.g.

....0202;Groundhog Day

Is there a way to modify Eric’s code to include annual events?

Thanks,
Gt

You can add [enlist<events>prefix[....]] to the filter syntax. For example, like this:

<$list filter="[enlist<events>prefix[2024]] [enlist<events>prefix[....]] +[sort[]]" variable="event">

The above will list all events for 2024 AND all annual events.

enjoy,
-e

@EricShulman, Thanks for the filter syntax, the annual events are now also retrieved.

Using the syntax to retrieve 2021 events :

<$list filter="[enlist<events>prefix[2021]] [enlist<events>prefix[....]] +[sort[]]" variable="event">

results in the display of a list of annual events followed by specific events :

....0202 - US Events: Groundhog Day (US)
20210120 - US Events: Inauguration Day (US)
20210314 - US Events: Daylight Saving Time starts (US)
20211107 - US Events: Daylight Saving Time ends (US)

Can the annual and specific date events be sorted into chronological order? Like this :

20210120 - US Events: Inauguration Day (US)
....0202 - US Events: Groundhog Day (US)
20210314 - US Events: Daylight Saving Time starts (US)
20211107 - US Events: Daylight Saving Time ends (US)

This type of chronological sorting would only make sense for events from a single year.

Thanks,
Gt

Use this:

<$list filter="[enlist<events>prefix[2021]] [enlist<events>prefix[....]]
    :sort[<currentTiddler>split[]first[8]last[4]join[]]" variable="event">

notes:

  • the :sort filter run prefix defaults to ascending order using text comparison. This works because all the events start with numbers, and the month and day numbers are zero padded.
  • Note that, unlike the sort[] filter operator, the :sort[...] filter run prefix does the sorting based on a computed value rather than a field reference, while still retaining the entire event string in the output.
  • The filter run within the :sort[...] takes each event string (referenced as <currentTiddler>) and uses split[]first[8]last[4]join[] to isolate the mmdd portion of the date which it then uses to perform the sorting.

enjoy,
-e

Thank you @EricShulman for the solution and clear explanation.

Gt.