Because of TimeZone.getDefault() for DTSTART:20130610T120000Z
event.getDateStart().getValue() gives
2013-06-10T12:00:00Z
and
event.getRecurrenceRule().getDateIterator(event.getDateStart().getValue()).next() gives
2013-06-10T10:00:00Z
May be a timezone parameter is missing in the getDateIterator ?
Thanks.
Stringstr="BEGIN:VCALENDAR\r\n"+"VERSION:2.0\r\n"+"PRODID:-//Microsoft Corporation//Outlook 14.0 MIMEDIR//EN\r\n"+"BEGIN:VEVENT\r\n"+"UID:0123\r\n"+"DTSTAMP:20130601T080000Z\r\n"+"SUMMARY;LANGUAGE=en-us:Team Meeting\r\n"+"DTSTART:20130610T120000Z\r\n"+"RRULE:FREQ=WEEKLY;INTERVAL=2\r\n"+"END:VEVENT\r\n"+"END:VCALENDAR\r\n";ICalendarc=Biweekly.parse(str).first();VEventevent=c.getEvents().get(0);assertEquals("DTSTART doit être correct",Instant.parse("2013-06-10T12:00:00Z"),event.getDateStart().getValue().toInstant());DateIteratordateIterator=event.getRecurrenceRule().getDateIterator(event.getDateStart().getValue());assertEquals("La première occurence doit être",Instant.parse("2013-06-10T12:00:00Z"),dateIterator.next().toInstant());assertEquals("La seconde occurence doit être",Instant.parse("2013-06-10T12:00:00Z"),dateIterator.next().toInstant());
Last edit: Mickaël 2014-12-03
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No, it's a bug. You shouldn't need to pass a timezone into the "getDateIterator()" method. The problem is that it's using the raw date/time components from the date string to create the date iterator instead of the actual timestamp. I've fixed it in this commit. Thanks for reporting this!
Workaround: Create a copy of the DTSTART value as shown below, then pass it into the getDateIterator() method:
Hello,
Firstly thank you for your work,
I am testing RecurrenceRule object and in RecurrenceProperty there is in the method getDateIterator this :
RecurrenceIteratorFactory.createRecurrenceIterator(rruleValue, dtstartValue, TimeZone.getDefault());
Because of TimeZone.getDefault() for DTSTART:20130610T120000Z
event.getDateStart().getValue() gives
2013-06-10T12:00:00Z
and
event.getRecurrenceRule().getDateIterator(event.getDateStart().getValue()).next() gives
2013-06-10T10:00:00Z
May be a timezone parameter is missing in the getDateIterator ?
Thanks.
Last edit: Mickaël 2014-12-03
No, it's a bug. You shouldn't need to pass a timezone into the "getDateIterator()" method. The problem is that it's using the raw date/time components from the date string to create the date iterator instead of the actual timestamp. I've fixed it in this commit. Thanks for reporting this!
Workaround: Create a copy of the DTSTART value as shown below, then pass it into the
getDateIterator()
method: