Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Best API format for recurring schedules?
5 points by seveibar on Jan 26, 2023 | hide | past | favorite | 5 comments
I'm trying to develop a standard by which people can submit recurring schedules for things like thermostats and access codes for smart locks for seam.co. I couldn't find any standard for recurring schedules other than the iCalendar format, which seems a bit unwieldy for a JSON API.

Cron is a bit limited, e.g. doesn't represent ranges of time.

This seems like a really common problem, anybody solving this in their work today?



I'd probably start with google calendar's docs.

Looks like it has a decent API for this: https://developers.google.com/calendar/api/guides/recurringe...

Edit: also this: https://developers.google.com/calendar/api/v3/reference/even...


The first link looks like a good translation of the iCalendar to JSON, I guess you can't really beat the iCalendar standard when it comes to representing events!



Those libraries are helpful thanks! I didn't know icalendar had an RFC, very helpful!


Many years ago, I built a calendaring system and I ended up implementing iCalendar but in a database instead of a file. I would not recommend doing it the way I did, but I did come to the conclusion that if you want to support the same types of recurrences, you really should be very familiar with how icalendar handles things or you'll forget something important.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: