Closed jtammen closed 5 years ago
This appears to still be the case, and it's in direct conflict with the standard which states:
""" Recurrence rules may generate recurrence instances with an invalid date (e.g., February 30) or nonexistent local time (e.g., 1:30 AM on a day where the local time is moved forward by an hour at 1:00 AM). Such recurrence instances MUST be ignored and MUST NOT be counted as part of the recurrence set. """
https://tools.ietf.org/html/rfc5545
this is what python's dateutil does:
>>> from dateutil.rrule import rrule, MONTHLY
>>> from datetime import datetime
>>> r = rrule(MONTHLY, dtstart=datetime(2016, 1, 30))
>>> r.between(datetime(2017, 1, 1), datetime(2017, 4, 1))
[datetime.datetime(2017, 1, 30, 0, 0), datetime.datetime(2017, 3, 30, 0, 0)]
whereas ical4j displays the behavior described in the previous comment.
This was a bug but I believe it should now be fixed. The results from the latest release as follows:
20140730T000000/PT0S
20140830T000000/PT0S
20140930T000000/PT0S
20141030T000000/PT0S
20141130T000000/PT0S
20141230T000000/PT0S
20150130T000000/PT0S
20150330T000000/PT0S
20150430T000000/PT0S
20150530T000000/PT0S
20150630T000000/PT0S
You can see with the latest implementation that Feb dates are skipped because there is no Feb 30th.
Awesome, thank you for checking back on this!
When I want to calculate the recurrence set of a monthly recurring event that starts on a date with day of month > 28, I am getting unexpected results.
Example:
This will give me the following periods:
As you can see, starting with February 2015, the date is changed to 28. I would either expect that the invalid date 2015-02-30 would be discarded and not converted to 2015-02-28 or that the next occurrence would be 2015-03-30 and not 2015-03-28.
Is this the intended behavior of ical4j or is it a bug?
Version: 1.0.3, but latest (1.0.5.2) is also affected.