I have a calendar with lots of different events. Some are single days, some span for months, others recur on specific dates, and some others recur on specific dates but also span several days.
How would I display the date of an occurrence while it is in progress, otherwise display the next occurrence?
This is what I have now:
{exp:calendar:occurrences
event_id="{event_id}"
date_range_start="today"
date_range_end="+ 1 year"
occurrences_limit="1"}
{if '{occurrence_start_date format="%d/%m/%Y"}' == '{occurrence_end_date format="%d/%m/%Y"}'}
{occurrence_start_date format="%d/%m/%Y"}
{if:else}
{occurrence_start_date format="%d/%m/%Y"} - {occurrence_end_date format="%d/%m/%Y"}
{/if}
{/exp:calendar:occurrences}
This works most of the time, but breaks when there are recurring events spanning multiple days. For example, an event which recurs "every other weekend" will be displayed properly until Sunday, since the occurrence start date is Saturday.