Calendar Events Search page group sorting

(Sean) #1

Hi all

I have a calendar Events Search page that displays calendar events in a simple list.
Sorting of this works in chronological order as expected by sorting by %instance_start_datetime%

I’d like to be able to group them though so that events on the same day fall under a group heading which also works with the below settings

The issue is that the groups seem to sort alphabetically (mostly).
I’ve done quite a bit of searching and found a few posts on the topic but nothing definitive on what I want to do.

Is it possible to sort Calendar events groups chronologically or is there a workaround using metadata values or something?

Thanks in advance

(Bart Banda) #2

Grouping is only able to do it based on the name of the group, not on any other meaning, as it’s a generic grouping mechanism.

If you want to group them on the frontend by dates, you could probably do something with server-side JS where for each event you print, you check if it’s on the same day as the previous event and if not, print a day heading.

(Sean) #3

Thanks for the reply Bart.
We reworked it so that grouping isn’t necessary now.

For anyone else wanting an easy workaround:
We now only create an event instance for each day it occurs on and not for each time on each day.
We then use a metadata field to list the times the events are on for each day instead of entering a time in the event instance itself.

Thanks again