rem: alarmTime = item.endDate.clone(); 
add: if (isEvent(item)) alarmTime = item.endDate.clone(); else alarmTime = item.dueDate.clone(); 
context: function saveDialog(item){    setItemProperty(item, "title",       getElementValue("item-title"));    setItemProperty(item, "LOCATION",    getElementValue("item-location"));    setItemProperty(item, "URL",         getElementValue("item-url"));    setItemProperty(item, "DESCRIPTION", getElementValue("item-description"));    if (isEvent(item)) {        var startDate = jsDateToDateTime(getElementValue("event-starttime"));        var endDate = jsDateToDateTime(getElementValue("event-endtime"));        var isAllDay = getElementValue("event-all-day", "checked");        if (isAllDay) {            startDate.isDate = true;            startDate.normalize();            endDate.isDate = true;            endDate.day += 1;            endDate.normalize();        }        setItemProperty(item, "startDate",   startDate);        setItemProperty(item, "endDate",     endDate);    }    if (isToDo(item)) {        var dueDate = getElementValue("todo-has-duedate", "checked") ?             jsDateToDateTime(getElementValue("todo-duedate")) : null;        setItemProperty(item, "dueDate",     dueDate);        setItemProperty(item, "isCompleted", getElementValue("todo-completed", "checked"));    }    /* attendence */    item.removeAllAttendees();    var attendees = getElementValue("item-attendees");    if (attendees != "") {        for each (var addr in attendees.split(",")) {            if (addr != "") {                var attendee = createAttendee();                attendee.id = "mailto:" + addr;                item.addAttendee(attendee);            }        }    }    /* recurrence */    if (getElementValue("item-recurrence", "checked")) {        if (window.recurrenceInfo) {            item.recurrenceInfo = window.recurrenceInfo;        }    } else {        item.recurrenceInfo = null;    }    /* alarms */    var hasAlarm = (getElementValue("item-alarm") != "none");    if (!hasAlarm) {        item.deleteProperty("alarmLength");        item.deleteProperty("alarmUnits");        item.deleteProperty("alarmRelated");        item.alarmTime = null;    } else {        var alarmLength = getElementValue("alarm-length-field");        var alarmUnits = document.getElementById("alarm-length-units").selectedItem.value;        var alarmRelated = document.getElementById("alarm-trigger-relation").selectedItem.value;        setItemProperty(item, "alarmLength",  alarmLength);        setItemProperty(item, "alarmUnits",   alarmUnits);        setItemProperty(item, "alarmRelated", alarmRelated);        var alarmTime = null;        if (alarmRelated == "START") {            alarmTime = item.startDate.clone();        } else if (alarmRelated == "END") {            alarmTime = item.endDate.clone();        }        switch (alarmUnits) {        case "minutes":            alarmTime.minute -= alarmLength;            break;        case "hours":            alarmTime.hour -= alarmLength;            break;        case "days":            alarmTime.day -= alarmLength;            break;        }        alarmTime.normalize();        setItemProperty(item, "alarmTime", alarmTime);    }    dump(item.icalString + "\n");}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/edb75cb3aa7fe2a0098e7d7a97a91ce5dd7f6556/calendar-event-dialog.js/clean/calendar/base/content/calendar-event-dialog.js