0

I am developing a calendar application,where i have created a recurring event n native BB calendar which starts from 1st jan and ends on 3rd jan .So when i use the below api

private EventList getEventList() {
        EventList eventList = null;
        try {
            eventList = (EventList) PIM.getInstance().openPIMList(
                    PIM.EVENT_LIST, PIM.READ_ONLY);
            Enumeration events = eventList.items();
            while (events.hasMoreElements()) {

                Event event = (Event) events.nextElement();
                int eve = eventList.OCCURRING;
                System.out.println("eve" + eve);
                long start = event.getDate(Event.START, 0);
                SimpleDateFormat sdf = new SimpleDateFormat("MMM dd,yyyy HH:mm");
                String date = sdf.formatLocal(start);
                System.out.println("List of dates:" + date);

                System.out.println("event is:" + event);
            }
        }

This gives me only the date 1st jan it is not retruning 2nd and 3rd jan dates.This issue is only with evetns which are recurring.

harqs
  • 177
  • 1
  • 11

1 Answers1

1

You'll want to call event.getRepeat() to get the RepeatRule object associated with the event. Note that it can be null if the event isn't recurring.

Then check out the dates function which can give you a list of the dates it occurs on in some range.

mparizeau
  • 663
  • 5
  • 12