Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
Contributor
Posts: 32
Registered: ‎01-18-2011
My Device: Curve 8900

How to create Calendar Recurrence?

No idea how to use Recurrence, I want to set a weekly event from some user input, but my code didn't work:

 

CalendarEvent weeklyEvent;
		weeklyEvent.setSensitivity(Sensitivity::Personal);
		weeklyEvent.setAccountId(1);
		weeklyEvent.setFolderId(selectedFolder.id());

		QDateTime nextHour = mapResult["reminderTime"].toDateTime();
		nextHour.addSecs(3600);
		weeklyEvent.setStartTime(mapResult["reminderTime"].toDateTime());
		weeklyEvent.setEndTime(nextHour);

		Recurrence recurrence;
		recurrence.setFrequency(Frequency::Weekly);
recurrence.setDayInWeek(2); weeklyEvent.setRecurrence(recurrence); weeklyEvent.setSubject(mDescriptionText->text()); calendarService.createEvent(weeklyEvent); mapResult["weeklyEventId"] = weeklyEvent.id();