983f4b43

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

Committer: Tom Sydney Kerckhove <NorfairKing@users.noreply.github.com>

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 1m10s 0s 0s 1m11s 1m10s
Eval 1m11s 10s 10s 1m21s 0s
Build 1m21s 0s 21m41s 23m02s 21m41s
Suite 1m10s 11s 21m52s 23m02s 22m51s

Timeline

0s1m20s