google-rfc-2445 icon indicating copy to clipboard operation
google-rfc-2445 copied to clipboard

Incorrect expected results.

Open cico1980 opened this issue 8 years ago • 1 comments

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

cico1980 avatar May 22 '17 08:05 cico1980

It is mentioned here https://code.google.com/archive/p/google-rfc-2445/issues/12

echo-xu-eb avatar Jul 09 '17 07:07 echo-xu-eb