Skip to content
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

[Feature Request] Grouping iCalendar event with RRULE #46

Open
Victrid opened this issue Sep 17, 2021 · 7 comments
Open

[Feature Request] Grouping iCalendar event with RRULE #46

Victrid opened this issue Sep 17, 2021 · 7 comments

Comments

@Victrid
Copy link

Victrid commented Sep 17, 2021

Most classes are planned weekly or biweekly, it could be better to use recurrence rule defined in iCalendar specifications. This will allow calendar app users to edit their events efficiently.

@skyzh
Copy link
Member

skyzh commented Sep 17, 2021

We need to consider two cases:

  • How to handle holidays?
  • How to handle courses that occur at 3, 5, 7, 11 weeks?

If these could be easily handled with RRULE, I'm willing to make the change.

@Victrid
Copy link
Author

Victrid commented Sep 18, 2021

Though it could be pretty dumb, it can be done by BYYEARDAY in RRULE. This is an example that the event is set to happen on 2021-09-15, 2021-09-16, and 2021-10-26.

BEGIN:VCALENDAR
...
BEGIN:VEVENT
DTSTAMP:20210918T024340Z
CREATED:20210918T024340Z
LAST-MODIFIED:20210918T024340Z
SUMMARY:test
RRULE:FREQ=YEARLY;UNTIL=20220101T050000Z;BYYEARDAY=258, 259, 299
EXDATE;TZID=Asia/Shanghai:20210918T130000
DTSTART;TZID=Asia/Shanghai:20210915T130000
DTEND;TZID=Asia/Shanghai:20210915T144000
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR 

As long as the course is arranged the same time on clock, it can be grouped. As the iCalendar exported hard-coded every event's time, and as courses' range less than 1 year, the RRULE is actually appointing unique dates. It would not be hard to implement for your cases.

@Victrid
Copy link
Author

Victrid commented Sep 18, 2021

This feature is written in RFC5545, so calendar app supporting iCalendar should have the support.

@Victrid
Copy link
Author

Victrid commented Sep 18, 2021

Take ME210/SI1210 工程实践 as an example, this course has no location on the schedule and the actual course time is 12:55-17:40 instead of 12:00-17:40 on i.sjtu.edu.cn, it would be more convenient to change all the course information at once.

@skyzh
Copy link
Member

skyzh commented Sep 18, 2021

LGTM to me. I'll add this support sometime later.

@skyzh
Copy link
Member

skyzh commented Sep 18, 2021

What if the course crosses two years? e.g. a 2021 fall course may span 2021 and 2022.

@Victrid
Copy link
Author

Victrid commented Sep 18, 2021

you could assign the BYYEARDAY like 362, 363, 364, 365, 1, 2, 3, 4, and set the start day (DTSTART) and end day (RRULE/UNTIL) to limit them in 2021-09 to 2022-02.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants