0

I am banging my head looking at the code for ... quite some time.

I have a lightning event, created from ics (including an alarm). I want to delete the alarm after something has occurred. I found calItemBase has mAlarms. But how to delete a single alarm? (there should be only one). What is the proper value of mAlarms if there is no alarm? What to do with mAlarmLastAck and other properties?

My workaround is to recreate from ical without the alarm, but then the user looses categories and other things he set for the event in the UI.

Many thanks,

Klaus

opto
  • 23
  • 5

1 Answers1

0

A summary of the methods intended to be public for an item can be seen here: http://mxr.mozilla.org/comm-central/source/calendar/base/public/calIItemBase.idl

Specifically, there is a deleteAlarm method. Example:

var alarms = item.getAlarms({});
item.deleteAlarm(alarms[0]);

If you are sure you want to delete all alarms, you can also use the clearAlarms method.

item.clearAlarms();
Philipp Kewisch
  • 982
  • 6
  • 20
  • my shame - I was really looking only a few lines above that. Spent my major time trying to understand the Event Dialog and what it does with alarms ..... In any case, many thanks - works like a charm. And many thanks pointing me to the IDL files - that helps tremendously, because they spell out the type/classes of the various member variables. I spent quite some time figuring out what a startdate is (trial and error of copying date variations always threw exceptions) until I found it in calIEvent.idl Klaus – opto Sep 28 '15 at 21:09