Gum-Joe / isitweeka

Site for isitweeka.com
https://isitweeka.com
MIT License
7 stars 3 forks source link

Fix for new calendar with RRules #81

Closed ILikeTeaALot closed 2 years ago

ILikeTeaALot commented 2 years ago

This year, KECHB decided to move to a repeated event rather than individual events for each week. this caused major issues.

In this PR, a fix is included which does the following:

  1. uses the rrule library (already installed thanks to the ical library) to convert RRule strings into usable classes
  2. using (1), adds all recurrences to the calendar events map before the main filtering begins. This includes handling of start dates (which many RRules do not have, and as such the RRule library does not handle properly, instead using the current time for the beginning of an RRule, which is just straight up not helpful) and other funky stuff
  3. It also includes a fix to handle week A/B events that are not formatted correctly (i.e. uppercase, lowercase, extra whitespace)

All together, this was a horrible experience due to awful documentation and broken implementations!

This code should work as long as a calendar with week A/B events is available, and should be effectively bulletproof (of course, having typed that, I have now jinxed it. Have fun future maintainers!)

ILikeTeaALot commented 2 years ago

Let's not delete this one