rem: if (!updateTaskAlarmWarnings()) { enableAccept = false; }  
context: function updateAccept() {    var enableAccept = true;    var kDefaultTimezone = calendarDefaultTimezone();    // don't allow for end dates to be before start dates    var startDate;    var endDate;    if (isEvent(window.calendarItem)) {        startDate = jsDateToDateTime(getElementValue("event-starttime"));        endDate = jsDateToDateTime(getElementValue("event-endtime"));        var menuItem = document.getElementById('menu-options-timezone');        if (menuItem.getAttribute('checked') == 'true') {            var startTimezone = gStartTimezone;            var endTimezone = gEndTimezone;            if (endTimezone == "UTC") {                if (gStartTimezone != gEndTimezone) {                    endTimezone = gStartTimezone;                }            }            startDate = startDate.getInTimezone(kDefaultTimezone);            endDate = endDate.getInTimezone(kDefaultTimezone);            startDate.timezone = startTimezone;            endDate.timezone = endTimezone;        }        startDate = startDate.getInTimezone(kDefaultTimezone);        endDate = endDate.getInTimezone(kDefaultTimezone);        // For all-day events we are not interested in times and compare only        // dates.        if (getElementValue("event-all-day", "checked")) {            // jsDateToDateTime returnes the values in UTC. Depending on the            // local timezone and the values selected in datetimepicker the date            // in UTC might be shifted to the previous or next day.            // For example: The user (with local timezone GMT+05) selected            // Feb 10 2006 00:00:00. The corresponding value in UTC is            // Feb 09 2006 19:00:00. If we now set isDate to true we end up with            // a date of Feb 09 2006 instead of Feb 10 2006 resulting in errors            // during the following comparison.            // Calling getInTimezone() ensures that we use the same dates as            // displayed to the user in datetimepicker for comparison.            startDate.isDate = true;            endDate.isDate = true;        }    } else {        startDate = getElementValue("todo-has-entrydate", "checked") ?            jsDateToDateTime(getElementValue("todo-entrydate")) : null;        endDate = getElementValue("todo-has-duedate", "checked") ?            jsDateToDateTime(getElementValue("todo-duedate")) : null;    }    if (endDate && startDate && endDate.compare(startDate) == -1) {        enableAccept = false;    }    if (!updateTaskAlarmWarnings()) {        enableAccept = false;    }    var accept = document.getElementById("cmd_accept");    if (enableAccept) {        accept.removeAttribute('disabled');    } else {        accept.setAttribute('disabled', 'true');    }    return enableAccept;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/9421/9d1428d8c69f934660c4623c06f109ff3d558f8b/sun-calendar-event-dialog.js/clean/calendar/prototypes/wcap/sun-calendar-event-dialog.js