u01jmg3 / ics-parser

Parser for iCalendar Events • PHP 8+, 7 (≥ 7.4), 5 (≥ 5.6)
MIT License
450 stars 144 forks source link

Use ISO Year within WEEKLY recurrence handling #256

Closed s0600204 closed 4 years ago

s0600204 commented 4 years ago

When setting the date for an occurrence of a recurring event where the RRULE has a frequency of WEEKLY and BYDAY was used, the setISODate() method is used.

Unfortunately, I had used Y instead of o as the date format code for getting the current year, thus feeding the Gregorian year instead of the ISO year into the method.

This was causing some year-start/end edge-case errors, as described in #251.

Essentially, I was committing the opposite of the error that Twitter is thought to have made in late 2014, as described in this video by Tom Scott: https://www.youtube.com/watch?v=D3jxx8Yyw1c (They should have used Gregorian and were using ISO, we should have been using ISO and were using Gregorian.)


Fixes #251

u01jmg3 commented 4 years ago

Once again, thanks @s0600204