我正在使用google-rfc-2445库来确定我从他们的 android 设备上的用户日历中提取的下一个会议日。我得到的重复规则的示例格式是:
FREQ=WEEKLY;UNTIL=20140826T223000Z;WKST=MO;BYDAY=TU
我DateIteratorFactory.createDateIterator()
用来确定下一次会议日期。如果我关闭严格模式,则返回的只是会议的开始日期。开启严格模式,没有返回任何内容,当我阅读日志时,我看到一条错误消息:
"java.text.ParseException: FREQ=WEEKLY;UNTIL=20140826T223000Z;WKST=MO;BYDAY=TU
(在偏移量 0 处)”。
有任何想法吗?我将在下面列出我的代码,例如,我只是在我的示例中使用系统时间。
rrule = "Date start = new Date(System.currentTimeMillis());"
Date start = new Date(System.currentTimeMillis());
TimeZone dt = TimeZone.getDefault();
// Next Notification
Date f = null;
try {
DateIterator di = DateIteratorFactory.createDateIterator(rrule, start, dt, true);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println("Next = " + f);