我正在使用实现 google-rfc-2445 ( https://code.google.com/p/google-rfc-2445/ ) 来生成应该在事件之后重复的日期,而不是作为规则指示 ( RRULE) 重复完成还要记下时间,即下次我也扔的时候计算日期。
example:
Start Date: 17/04/2013 8:30 a.m.
Rule: "RRULE: FREQ = DAILY; UNTIL = 20130430T083000Z, INTERVAL = 1"
Expected Result, Next Repetition: 4/18/2013 8:30 a.m.
Result Obtained, Next Repetition: 4/18/2013 00 00 00
这是我正在使用的代码
LocalDate start = new LocalDate(System.currentTimeMillis());
String ical = "RRULE:FREQ=DAILY;"
+ "UNTIL=20130430T083000Z;"
+ "INTERVAL=1;";
//Next Notification
Date f = null;
for (LocalDate date
: LocalDateIteratorFactory.createLocalDateIterable(ical, start, false)) {
f = date.toDateTimeAtCurrentTime().toLocalDate().toDate();
break;
}
System.out.println("Next = " + f);
打印结果为 Next = Wed Apr 17 00:00:00 COT 2013
是“BYHOUR = 8; BYMINUTE = 05; BYSECOND = 10”的存在,而不是如何使用它,如果我能伸出援手,谢谢。