BlackBerry Forums Support Community
              

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

Please Login to Remove!

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
Offline  
Old 08-01-2005, 06:06 AM   #2 (permalink)
crs
BlackBerry Extraordinaire
 
Join Date: Oct 2004
Model: 8800
Carrier: cingular
Posts: 1,034
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Carey,

Check the RIM Developer forum, I responded.

Mark
Offline  
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

Intel ES Confidential QGUZ Xeon E7-8893v3 QUAD-CORE 3.2GHZ 45MB 9.6GT/S Q
$600.0
Intel ES Confidential QGUZ Xeon E7-8893v3 QUAD-CORE 3.2GHZ 45MB 9.6GT/S Q pictureNEC Express 5800 R110F-1E Xeon E3-1220 v2 (Quad Core 3.1Ghz), 8 GB DDR-1600, 500
$750.0
NEC Express 5800 R110F-1E Xeon E3-1220 v2 (Quad Core 3.1Ghz), 8 GB DDR-1600, 500 pictureDell Electronics PowerEdge 2950 Server (9424)
$15.0
Dell Electronics PowerEdge 2950 Server (9424) pictureHoneywell Xeon 1900 USB Barcode Scanner 1900HHD-0
$35.0
Honeywell Xeon 1900 USB Barcode Scanner 1900HHD-0 pictureNew HP Proliant DL380 Gen4/ML370 Server Intel Xeon Processor 311584-B21
$25.19
New HP Proliant DL380 Gen4/ML370 Server Intel Xeon Processor 311584-B21 picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.