rem: update_date(); 
add: scheduleMidnightUpdate(refreshUIBits); 
context: function calendarInit() {   // set up the CalendarWindow instance      gCalendarWindow = new CalendarWindow();   // Set up the checkbox variables.  Do not use the typical change*() functions   // because those will actually toggle the current value.   if (document.getElementById("toggle_workdays_only").getAttribute("checked")       == 'true') {       var deck = document.getElementById("view-deck")       for each (view in deck.childNodes) {           view.workdaysOnly = true;       }       deck.selectedPanel.goToDay(deck.selectedPanel.selectedDay);   }   // tasksInView is true by default   if (document.getElementById("toggle_tasks_in_view").getAttribute("checked")       != 'true') {       var deck = document.getElementById("view-deck")       for each (view in deck.childNodes) {           view.tasksInView = false;       }       deck.selectedPanel.goToDay(deck.selectedPanel.selectedDay);   }   // set up the unifinder      prepareCalendarUnifinder();   prepareCalendarToDoUnifinder();      update_date();   checkForMailNews();   initCalendarManager();   // fire up the alarm service   var alarmSvc = Components.classes["@mozilla.org/calendar/alarm-service;1"]                  .getService(Components.interfaces.calIAlarmService);   alarmSvc.timezone = calendarDefaultTimezone();   alarmSvc.startup();   if (("arguments" in window) && (window.arguments.length) &&       (typeof(window.arguments[0]) == "object") &&       ("channel" in window.arguments[0]) ) {       gCalendarWindow.calendarManager.checkCalendarURL(            window.arguments[0].channel );   }   // a bit of a hack since the menulist doesn't remember the selected value   var value = document.getElementById( 'event-filter-menulist' ).value;   document.getElementById( 'event-filter-menulist' ).selectedItem =        document.getElementById( 'event-filter-'+value );   var toolbox = document.getElementById("calendar-toolbox");   toolbox.customizeDone = CalendarToolboxCustomizeDone;   document.getElementById("view-deck")           .addEventListener("dayselect", observeViewDaySelect, false);}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/b3bda95f053e8ff65c4e6ff1293921e040a30789/calendar.js/buggy/calendar/resources/content/calendar.js