BlackBerryForums.com : Your Number One BlackBerry Community      

»Sponsored Links




Closed Thread
 
LinkBack Thread Tools
  (#1 (permalink)) Old
New Member
 
Posts: 10
Join Date: Jun 2005
Model: 8250
Default Problem with recurring events - 07-31-2005, 08:14 PM

Hi All,

I'm trying to write some code to get a list of all events between a start time and and end time, including *recurring events* (which is a problem!).

I am using the following code (with error checking removed to simplify the post):

eventList = (EventList)PIM.getInstance().openPIMList( PIM.EVENT_LIST, PIM.READ_ONLY);
...
Enumeration e = eventList.items();
...
while (e.hasMoreElements())
{
Event event = (Event)e.nextElement();
RepeatRule rr = event.getRepeat();
if (rr != null)
{
Enumeration eRR = null;

origStartTime = event.getDate(Event.START,0);
startTime = //two days ago;
endTime = //two weeks from today;
eRR = rr.dates(origStartTime,startTime,endTime);
if (eRR != null)
{
while (eRR.hasMoreElements())
{
Date d = (Date)eRR.nextElement();
// d should get dates between startTime
// and endTime during the iteration
}
}
}

So here's the problem:

If I create a recurring event in the calendar that recurs daily, I find that the above code works fine. In other words, my enumeration eRR has all of the recurrences of the event occuring between -2 days and + 14 days from the current date. However, if I create a recurring event in the calendar that recurs *weekly*, while the PIM app shows the recurring event in its GUI, I find that my enumeration eRR does not contain any events between my start and end times.

I am certain that startTime and endTime are correct as I have printed them out and verified them. Any ideas?

Thanks,

Carey
   
Sponsored Links
Please Login or Register to Remove these Advertisements!

  (#2 (permalink)) Old
crs Offline
CrackBerry Addict
 
Posts: 979
Join Date: Oct 2004
Model: 8800
Carrier: cingular
Default 08-01-2005, 07:06 AM

Carey,

Check the RIM Developer forum, I responded.

Mark
   
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On






Copyright © 2004-2008 BlackBerryNews.com, BlackBerryFAQ.com, BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of Research In Motion Limited.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.1