mattlewis92 / angular-calendar

A flexible calendar component for angular 15.0+ that can display events on a month, week or day view.
https://mattlewis92.github.io/angular-calendar/
MIT License
2.73k stars 867 forks source link

Fiirst-class ICalendar support? #1240

Open tadzik opened 4 years ago

tadzik commented 4 years ago

I've seen it requested before (in https://github.com/mattlewis92/angular-calendar/issues/993), but I wonder how you'd feel about an official (or semi-official) support of ICalendar in angular-calendar.

We've built a partial support for this at Runbox, as a custom implementation of a CalendarEvent, with Mozilla's ICAL.js serving as the parser. Having learned much about ICals while writing this, it's probably going to need a bit of a rewrite in order to better model ICal events, especially recurring ones, so maybe it can be an opportunity to turn it into something more generic, and useful to other angular-calendar users.

The question is: would you be interested in either including a first-party support for ICals in angular-calendar or perhaps spinning off a sister project? We have some resources we're willing to spend on getting this right, but we could always benefit from some guidance and review, especially when it comes to angular-calendar integration :)

mattlewis92 commented 4 years ago

Hey Tadeusz! I had a bit of a think about this and I think it makes sense right now as a separate utility package as most of the real world uses cases I've seen with this project have just been fetching events from an api in regular json format, so I wouldn't want to bloat the bundle size with another dependency. So I think something like this would work:

import { toICal, fromICal } from 'angular-calendar-ical';

and those functions would be responsible for converting an ical event to a CalendarEvent and vice versa. I'd be more than happy to link to it from the readme + provide a demo on the docs site, plus provide any review and guidance you need (although I've never used ical myself before so I'm not sure how much use I'd be). Let me know if that works for you 😄