Closed CCBow-501 closed 2 years ago
Hi Denis,
The RecurrenceIterator requires the until date to be in UTC time due to how the date iteration code is implemented. This is one of the problems that this commit fixed, which I seemed to have neglected to mention in the commit message.
However, RecurrenceIterator still takes the time zone into account when iterating over the dates in the recurrence (at least, it's supposed to!).
Hello,
We are using this Library to generate instances from a series. Our series model consists of startDate (LocalDate) endDate (LocalDate) and a timezone.
So we are building a Recurrence like this:
If our series has no endDate we don't configure
until
and everything works fine. If endDate is set it is converted to ICalDate with the time 23:59:59 and the timeZone of the series:For an endDate of 2020-04-26 and a timeZone with a negative offset (e.g America/Managua) the conversion results in an instant of 2020-04-27T05:59:59Z
This leads to a different calculation of
until
in 0.6.3 and 0.6.5 which was changed in this commit: https://github.com/mangstadt/biweekly/commit/f1632351d3f023e8337e7bad34292f27f0176618#diff-46dc7f39fb49bcfadc7a87f606664f40713f0903572689551ddc87e89348b444With the old version and the re-convert with the tzid of the RecurrenceIterator:
untilUtc resulted in
20200426T235959
With the new implementation:
until gets treated like UTC and results in
20200427T055959
Is there a reason the new calculation completely ignores the timezone of the iterator?
Kind regards Denis