Search code examples
iosswiftcalendarkit

Create event across days in CalendarKit


Is it possible to create an event with a different start date and time and end date and time?

Example

start date is 2021-04-15 23:00

end date is   2021-04-16 02:00

Solution

  • Yes, it is possible.

    In your DataSource method func eventsForDate(_ date: Date) -> [EventDescriptor] include the event in the returned array if it occurs in a given date.

    For example, if the event starts 15:00 1st Jan and ends 16:30 3rd Jan, you'll need to return that event in the payload for the 1st, 2nd and 3rd January.

    CK should handle the layout and display of the events.