ics
ics copied to clipboard
createEvents: return iCal string with 0 events
Right now, createEvents
will return {error: null, value: null}
with 0 events. This is impractical, because IMO it is a common use case to server a calendar feed with 0 events (e.g. no upcoming events, or all cancelled/removed).
This PR changes createEvents
to return an empty (but valid) calendar feed in this case. Strictly speaking, this is a breaking change.
+1 for this. Currently fixing a bug that ended up originating from this library because of this. Seems like a missing feature, the fix would be appreciated. Will work around it for now. The library has been great apart from this! Thank you for your work 🙌
Thanks @derhuerst :) this saved me some headache. This really should be merged!
@adamgibbons Is this something that could get merged in? I was running into this same problem today.
Something to note here, as I created my own workaround until this merged.... with zero events in the file, there is no way to set any of the VCALENDAR
properties directly with this library. Without setting X-WR-CALNAME
, whatever application is handling your ICS file will have no idea what to name your calendar. It only works now because most applications (like Google Calendar) will fall back on using the CALNAME
property of the first event if nothing is set in VCALENDAR
.
Thanks for cleaning up the API with this. I'm going to do a major version bump for this since as you point out, it is a breaking change.