ics files - calendar management
Table of Contents
Converting ics to json
Sometimes, we have to convert events in ics files to json format to work with APIs like Google Calendar API. Here are some libraries that help with it.
- Java: https://github.com/ical4j/ical4j
- Javascript: https://www.npmjs.com/package/ical2json
- Python: https://github.com/CalyFactory/python-jicson
- awk: https://github.com/loteoo/icsp
Handling events
- When you create events, rather than creating them in gmail calendar or any other calendar in particular, create “.ics” files for them and then import the ics file into your calendar. That way, you have the source code for the event in your repository and you can import it wherever you want.
- Do not set end dates on events. If a series of events become irrelevant at any point of time, just delete the series from your calendar. If you need to import that series into your calendar again, you can do using the source code for the ics.
ics Templates
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
RRULE:FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=1
SUMMARY:First day of the month - Do something on the first of every month
DTSTART:20230101T093000
DTEND:20230101T100000
SEQUENCE:0
DESCRIPTION:Task that needs to be done on the first of every month.
END:VEVENT
END:VCALENDAR