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
F13277112: D16611.diff
Fri, May 31, 8:29 AM
F13265912: D16611.diff
Tue, May 28, 7:07 AM
F13220095: D16611.id.diff
Sat, May 18, 11:13 PM
F13214418: D16611.diff
Fri, May 17, 10:21 AM
F13203003: D16611.diff
Tue, May 14, 11:23 PM
F13174425: D16611.diff
Tue, May 7, 11:14 PM
Unknown Object (File)
Mon, May 6, 10:29 AM
Unknown Object (File)
May 3 2024, 3:05 PM
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.