e6d97f3d

By: Tom Sydney Kerckhove <syd@cs-syd.eu>

ical-recurrence: bound a UTC Until by instants, not by local times

@
The UNTIL rule part defines a DATE or DATE-TIME value that bounds
the recurrence rule in an inclusive manner.
@

The bound is an instant, so whether an instance is inside it has to be
decided on instants.  Expressing the Until in the time zone of DTSTART
answers that correctly whenever the instance and the bound share an
offset from UTC, which covers every fixed-offset zone and all but about
an hour around each transition.  It cannot answer it across a transition,
where the local order and the order of the instants disagree.

Resolve the generated instances and compare them with the Until directly.
localiseUntil stays, now purely as a pre-filter so that an unbounded rule
does not generate occurrences all the way to the limit, and it gains a
day of slack so that it can never cut off an instance this filter would
have kept.

An instance whose local time cannot be resolved, or a rule whose time
zone the calendar does not define, is left alone: this only removes
instances it is sure about, so neither case turns into a failure.

Suite timing

Time to Start Worker time Duration Time to finish Idle
Config 40s 1s 1s 41s 40s
Eval 44s 13s 13s 58s 2s
Build 57s 7m10s 5m37s 6m34s 23s
Suite 40s 7m25s 5m54s 6m34s 1m06s

Timeline

0s2m3m4m5m6m