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
New Developer
Posts: 40
Registered: ‎12-14-2013
My Device: Playbook
My Carrier: Orange
Accepted Solution

Sorting calendar events

Hi,

 

Any idea how to sort the calendar events based on the event's date, that is, the event nearer should be at the top of the list? Any api to do the same. I'm trying hard to get it done.

 

Thanks

Developer
Posts: 120
Registered: ‎02-06-2013
My Device: DAB, DAC, Lost red Z10, Regular Replaced Z10, PlayBook
My Carrier: airtel

Re: Sorting calendar events

Try this

EventSearchParameters searchParameters;
    QPair<SortField::Type,bool> sort;
    sort.first = bb::pim::calendar::SortField::StartTime;
    sort.second = false;

searchParameters.setSort(sort);

 now pass this as a parameter to the events() method of the CalendarService class and you have the sorted events based on starttime

 

if you want to reverse the order, set the bool value to true



Looking for SMTP Servers, Bulk Emails and Bulk SMS services at an affordable price to help boost your business? Look no further. I've the solution for your needs. Contact me now.
New Developer
Posts: 40
Registered: ‎12-14-2013
My Device: Playbook
My Carrier: Orange

Re: Sorting calendar events

Thanks that worked.