Platforms to show: All Mac Windows Linux Cross-Platform
FAQ.How to create a birthday like calendar event?
// start a connection to the calendar databasedim s as new CalCalendarStoreMBS// needed for the error detailsdim e as NSErrorMBSdim r as CalRecurrenceRuleMBS = CalRecurrenceRuleMBS.initYearlyRecurrence(1, nil) // repeat every year without enddim a as new CalAlarmMBS // add alarma.action = a.CalAlarmActionDisplaya.relativeTrigger = -3600*24 // 24 Hours before// create a new calendardim c as new CalEventMBSdim d as new date(2011, 04, 20) // the datedim calendars() as CalCalendarMBS = s.calendars// set propertiesc.Title="Test Birthday"c.startDate=dc.recurrenceRule = rc.calendar=calendars(0) // add to first calendarc.addAlarm(a)c.endDate = dc.isAllDay = true// save eventcall s.saveEvent(c,s.CalSpanAllEvents, e)if e<>nil then MsgBox e.localizedDescriptionelse MsgBox "New event was created."end if
This adds an event to iCal for the given date with alarm to remember you and repeats it every year.