google-rfc-2445
google-rfc-2445 copied to clipboard
Incorrect expected results.
They should all be Monday, but they are all on Tuesday!!!!!
Source:
public static void main(String[] args) {
GregorianCalendar dateStart = new GregorianCalendar();
dateStart.set(2017, 04, 01, 01, 00 ,00);
String ical = "RRULE:FREQ=WEEKLY;WKST=MO;BYDAY=MO";
GregorianCalendar dateExit = new GregorianCalendar();
dateExit.set(2017, 5, 6);
// Print out each date in the series.
try {
for (Date date : DateIteratorFactory.createDateIterable(ical, dateStart.getTime(),
TimeZone.getTimeZone("UTC"), true)) {
System.out.println(date);
if (date.getTime() > dateExit.getTimeInMillis()){
break;
}
}
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Results: Mon May 01 01:00:00 CEST 2017 Tue May 02 01:00:00 CEST 2017 Tue May 09 01:00:00 CEST 2017 Tue May 16 01:00:00 CEST 2017 Tue May 23 01:00:00 CEST 2017 Tue May 30 01:00:00 CEST 2017 Tue Jun 06 01:00:00 CEST 2017 Tue Jun 13 01:00:00 CEST 2017
It is mentioned here https://code.google.com/archive/p/google-rfc-2445/issues/12