[icalendar-dev] how to verify if a date is into the ical file ?

Max M maxm at mxm.dk
Fri Mar 30 21:48:38 CEST 2007


Michael REMY Askus skrev:
 > hi,
 >
 > this is my first question after subscribed to the mailing list.
 > This module is very useful for my application (TinyERP) to determinate
 > easter days (stored in a iCal file)
 >
 > But, i don't find in the doc how to verifiy is a date is present or not
 > into a iCal file.
 > What is the method ?
 >
 > In waiting your answer, i justed do a string presence of the date, like
 > a novice !

You can just treat the ical object as a dict and loop through it:

for key in cal.keys():
     val = cal.decoded(key)
     if val = date:
         return True
return False


-- 

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science

Phone:  +45 46 93 23 92
Mobile: +45 29 93 42 96


More information about the icalendar-dev mailing list