Page MenuHomePhabricator

Fix RRULE bugs with week numbers for leading and trailing partial weeks
ClosedPublic

Authored by epriestley on Sep 28 2016, 12:08 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 18, 4:44 PM
Unknown Object (File)
Oct 20 2024, 5:14 PM
Unknown Object (File)
Oct 16 2024, 2:00 PM
Unknown Object (File)
Sep 15 2024, 10:42 PM
Unknown Object (File)
Sep 15 2024, 6:42 PM
Unknown Object (File)
Sep 12 2024, 10:59 AM
Unknown Object (File)
Sep 12 2024, 10:58 AM
Unknown Object (File)
Sep 12 2024, 10:58 AM
Subscribers
None

Details

Summary

Ref T10747. I only got this partially right:

  • When the last week of the year has less than 4 days, it's counted as the first week of the next year.
  • When the first week of the year has less than 4 days, it's counted as the last week of the prior year.

These rules are sort of crazy, but they work now.

Test Plan

Unit tests now pass.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Fix RRULE bugs with week numbers for leading and trailing partial weeks.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
src/parser/calendar/data/PhutilCalendarRecurrenceRule.php
628–633

I also added this safety check so we don't loop forever with contradictory rules like "BYWEEKNO=1, BYYEARDAY=300" (which can never occur, and might also be invalid -- I haven't tried to add all the "X must not be present if Y is present" checks from the spec yet) or because of bugs in the implementation.

chad edited edge metadata.
This revision is now accepted and ready to land.Sep 28 2016, 12:34 AM
This revision was automatically updated to reflect the committed changes.