Reputation: 479
Within a client-side JS application, I would like for users to be able to export an event on my site to their Apple iCalender. How do I construct that file so that they can download it?
Upvotes: 5
Views: 13171
Reputation: 479
Apple iCalender can import .ics (RFC 5545) extension files. The best site I've seen documenting how to represent the necessary metadata within one of these files is here: https://icalendar.org/.
This post explains how to deal with creating the file and downloading it from within a JS client.
Note: You want to set a data content type of: 'text/calendar;charset=utf-8;'.
Upvotes: 5