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
F14107936: D16611.diff
Wed, Nov 27, 9:25 AM
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
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
Branch
cal9
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 13873
Build 17954: Run Core Tests
Build 17953: arc lint + arc unit

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.