-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICS files for subscribing in Calendar #219
Conversation
Implements #215
Actually, I just noticed an issue. Conferences are showing up as one day too short. UIKonf (for example) should be 4 days long, not 3. |
Aha, I think I figured this out. In iCalendar files, all day events start on one day (ex: HOWEVER, this could cause issues (for example) if a conference occurs on Mar 30 - Mar 31, then the file generated would say it ended on I'm wondering if I want to try figuring out the syntax for "proper" date incrementing in Liquid 🤪 |
Nice addition! There's the The math will likely involve adding 86400 to the timestamp, so not perfect (DST and all) but more correct than adding 1 to the day number at least Side note / PS: would be nice to use that same ics template to also generate one ics per event and add a link to download it next to each conference in the list, to be able to easily just add the conference(s) one would be interested in instead of all at once |
i.e. probably something that would look like this in the template? (
|
iCalendar format is a bit strange with how it deals with dates. A date in a field is that starting _instant_ of when a thing starts or ends. Therefore an event that starts at `2020-01-22` and ends at `2020-01-22` has a length of "0". Conventionally we think it would mean "one day", but that's not how iCalendar format works. Therefore, we need to shift the end date _forward_ a day to represent the first instant of _after_ the event ends. Or in other words, an all-day event on Jan 22 starts at `2020-01-22` and ends at `2020-01-23`. However, that's not *quite* good enough, because we do have rogue leap hours that mix in. Therefore, we're going to shift forward by 36 hours so we can be sure we're solidly during the "next day" before we try to format it back down to just the year-month-day.
Thanks @AliSoftware! Based on this I got it working. I thought of just appending a time to the date fields (eg Calendar shows the events happening on the "right" days and they also correctly show up as all-day events for those days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we just need to add links to download those files 🙂
Amazing work, Dave! Just tested this and it works very well, both imoprting in iCalendar and in Google Calendar (in browser). As @AliSoftware said, we need to add the links to the calendars :). Let me know if you need help with that, I'd like to get this update merged in the next 10-12 hours so I can give it a shoutout in today's issue of iOS Goodies 😁 |
Woah, so cool! Thanks @davedelong. Some great learnings about iCal, too 😄 |
Initial include of calendar files
Merged the PR from @BasThomas which adds the links to the site. And now also merging this. Great suggestion, @BasThomas, and awesome work @davedelong! |
This is AMAZING!! Thank you @davedelong, @BasThomas, @AliSoftware and @mariusc! 👏 😃 |
Implements #215
This adds three files to the generated site:
/api/all.ics
,/api/cocoa.ics
, and/api/mobile.ics
.Every time the site is re-built, the three files are generated. They allow users to see all the conferences (or only cocoa conferences, or only mobile conferences) in their calendaring app of choice.
I've verified that the ICS files can be correctly read by Calendar.app.