rem:        var timezone = gEndTime.timezone; 
add: var timezone = gEndTimezone; 
context: function updateEndTime(){  if(gIgnoreUpdate)    return;      var startWidgetId;  var endWidgetId;  if (isEvent(window.calendarItem)) {    startWidgetId = "event-starttime";    endWidgetId = "event-endtime";  } else {    if (!getElementValue("todo-has-entrydate", "checked"))      gItemDuration = null;    if (!getElementValue("todo-has-duedate", "checked"))      gItemDuration = null;    startWidgetId = "todo-entrydate";    endWidgetId = "todo-duedate";  }  var saveStartTime = gStartTime;  var saveEndTime = gEndTime;  var kDefaultTimezone = calendarDefaultTimezone();  if(gStartTime) {    var start = jsDateToDateTime(getElementValue(startWidgetId));    start = start.getInTimezone(kDefaultTimezone);    start.timezone = gStartTime.timezone;    gStartTime = start;  }  if(gEndTime) {    var end = jsDateToDateTime(getElementValue(endWidgetId));    end = end.getInTimezone(kDefaultTimezone);    // this is a hack in my point of view. we need to convert    // the endtime into the timezone that is associated with the    // endtime. but in case it is "UTC" and starttime/endtime    // have different timezones, we convert into the timezone    // of the starttime. this makes editing starttime/endtime    // consistent but leaves the user with a hidden modification    // to the event.    var timezone = gEndTime.timezone;    if(timezone == "UTC") {      if(gStartTime && gStartTime.timezone != gEndTime.timezone) {        timezone = gStartTime.timezone;      }    }    end.timezone = timezone;    gEndTime = end;  }    // calculate the new duration of start/end-time.  // don't allow for negative durations.  var warning = false;  if(gStartTime && gEndTime) {    if(gEndTime.compare(gStartTime) >= 0) {      gItemDuration = end.subtractDate(start);    } else {      gStartTime = saveStartTime;      gEndTime = saveEndTime;      warning = true;    }  }  updateDateTime();  updateTimezone();    if(warning) {    var callback = function func() {      var promptService =                Components.classes["@mozilla.org/embedcomp/prompt-service;1"]                         .getService(Components.interfaces.nsIPromptService);      promptService.alert(null,document.title,"The end date you entered occurs before the start date.");    }    setTimeout(callback, 1);  }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/ca7555ce4d97c6f483b0d7c2b63d950532b4cc27/sun-calendar-event-dialog.js/clean/calendar/prototypes/wcap/sun-calendar-event-dialog.js