Dave's Brain

Browse - Programming Tips - Using libical, how do I iterate through all recurrences?

Date: 2010mar31
Language: C/C++
Library: libical

Q.  Using libical, how do I iterate through all recurrences?

A.  Here's how:

void AllRecurrences(icalrecurrencetype rule, icaltimetype dtstart) { icalrecur_iterator* reit; icaltimetype eventstart reit = icalrecur_iterator_new(rule, dtstart); for (eventstart = icalrecur_iterator_next(reit); !icaltime_is_null_time(eventstart); eventstart = icalrecur_iterator_next(reit)) { // Process eventstart } icalrecur_iterator_free(reit); }

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.