2014-06-27 32 views
1

我正在使用google-rfc-2445庫來確定我從用戶的日曆安裝在他們的android設備上的會議的下一個會議日。對於復發規則的一個例子格式我得到的回覆是:java.text.parse使用google-rfc-2445庫的例外

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); 

回答

2

我想通了這個問題,我不得不追加「RRULE:」對復發規則字符串開頭

+0

我從來沒有想過這件事KS!我也很討厭這個圖書館。 – StarWind0