ics icon indicating copy to clipboard operation
ics copied to clipboard

createEvents: return iCal string with 0 events

Open derhuerst opened this issue 4 years ago • 2 comments

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.

derhuerst avatar Sep 12 '20 12:09 derhuerst

+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 🙌

danielmizrachi avatar Jul 22 '21 15:07 danielmizrachi

Thanks @derhuerst :) this saved me some headache. This really should be merged!

pachacamac avatar Jun 06 '22 12:06 pachacamac

@adamgibbons Is this something that could get merged in? I was running into this same problem today.

garand avatar Nov 11 '22 05:11 garand

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.

mburroughs-trala avatar Dec 14 '22 22:12 mburroughs-trala

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.

adamgibbons avatar Feb 05 '23 19:02 adamgibbons