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
F13077842: D16611.diff
Tue, Apr 23, 5:51 AM
Unknown Object (File)
Fri, Apr 19, 5:22 PM
Unknown Object (File)
Thu, Apr 18, 2:16 AM
Unknown Object (File)
Mon, Apr 8, 2:05 AM
Unknown Object (File)
Sun, Apr 7, 11:02 AM
Unknown Object (File)
Sun, Mar 31, 7:37 AM
Unknown Object (File)
Sat, Mar 30, 1:36 PM
Unknown Object (File)
Mar 21 2024, 6:29 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.