rem:   newEndDate = timepopup.value.getTime() + gTimeDifference;  newEndDate = new Date( newEndDate ); 
add: var ThisDate = timepopup.value; 
context: function onTimePick( timepopup ){      //get the new end time by adding on the time difference to the start time.   newEndDate = timepopup.value.getTime() + gTimeDifference;         newEndDate = new Date( newEndDate );   if ( newEndDate.getDate() != timepopup.value.getDate() ) //if this moves us to tomorrow...   {      //put us back at today, with a time of 11:55 PM.      document.getElementById( "end-date-picker" ).value = newEndDate;   }      if( timepopup.timeField.id != "end-time-text" )   {      setTimeFieldValue( "end-time-text", newEndDate );   }         if ( ( timepopup.timeField.id == "end-time-text" ) )    {      //if we are changing the end time, change the global duration.      var EndTime = new Date( timepopup.value.getTime() );      var StartTimeElement = document.getElementById( "start-time-text" );      var StartTime = StartTimeElement.editDate;            gTimeDifference = EndTime - StartTime; //the time difference in ms            if ( gTimeDifference < 0 )       {         gTimeDifference = 0;      }   }      // display the new time in the textbox   timepopup.timeField.value = formatTime( timepopup.value );      // remember the new date in a property, "editDate".  we created on the time textbox      timepopup.timeField.editDate = timepopup.value;   updateOKButton();}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/d82b30a2b29f86e72f5024d3b5660ae22eb30296/eventDialog.js/buggy/calendar/resources/content/eventDialog.js