Is there a way to get the first and last days of a multi-day event? I want to be able to style the first and last days differently. I don't see anything like this in the docs.
This is in Craft 3 and Calendar 2.0.17
Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. It only takes a minute to sign up.
Sign up to join this communityIs there a way to get the first and last days of a multi-day event? I want to be able to style the first and last days differently. I don't see anything like this in the docs.
This is in Craft 3 and Calendar 2.0.17
Within the context of calendar.month
, if you check out the demo templates, we style the beginning and end of multi-day events with the following code:
{% if event.multiDay %}
{% set classes = classes ~ " multi_day" %}
{% set classes = classes ~ (day.containsDate(event.startDateLocalized) ? " first_day") %}
{% set classes = classes ~ (day.containsDate(event.endDateLocalized) ? " last_day") %}
{% endif %}