nwcell / ics.js

A browser firendly VCS file generator written entirely in javascript!!!!!!
MIT License
614 stars 258 forks source link

Added UID control #74

Open zachbornheimer opened 4 years ago

zachbornheimer commented 4 years ago

Apple Calendar and Google Calendar both have an issue if you download and add multiple calendars with the same UID and it will, randomly, overwrite data with each. This patch adds 3 new functions: .setUID(str) .autoUID(bool) .getUID(event_title, default)

This allows for each event to have a unique ID. setUID has the highest precedence so you can use a custom hashing function, if desired, or any other manual modification to the UID. This should be run before addEvent. The autoUID may be set as well to allow for multiple events to have automatic UIDs based on their title and dates.