rem: var thisDate = new Date( newYear, newMonth, dayNumber ); 
add: thisDate = new Date( newYear, newMonth, dayNumber ); 
context: MonthView.prototype.refreshDisplay = function monthView_refreshDisplay( ){    // set the month/year in the header      var selectedDate = this.calendarWindow.getSelectedDate();   var newMonth = selectedDate.getMonth();   var newYear =  selectedDate.getFullYear();   var titleMonthArray = new Array();   var titleYearArray = new Array();   var toDebug = "";   for (var i=-2; i < 3; i++){      titleMonthArray[i] = newMonth + i;      titleMonthArray[i] = (titleMonthArray[i] >= 0)? titleMonthArray[i] % 12 : titleMonthArray[i] + 12;      titleMonthArray[i] = this.calendarWindow.dateFormater.getMonthName( titleMonthArray[i] );      var idName = i + "-month-title";      document.getElementById( idName ).setAttribute( "value" , titleMonthArray[i] );   }	document.getElementById( "0-year-title" ).setAttribute( "value" , newYear );      var Offset = getIntPref(this.calendarWindow.calendarPreferences.calendarPref, "week.start", 0 );      NewArrayOfDayNames = new Array();      for( i = 0; i < ArrayOfDayNames.length; i++ )   {      NewArrayOfDayNames[i] = ArrayOfDayNames[i];   }   for( i = 0; i < Offset; i++ )   {      var FirstElement = NewArrayOfDayNames.shift();      NewArrayOfDayNames.push( FirstElement );   }   //set the day names    for( i = 1; i <= 7; i++ )   {      document.getElementById( "month-view-header-day-"+i ).value = NewArrayOfDayNames[ (i-1) ];   }      // Write in all the day numbers and create the dayBoxItemByDateArray, see notes above      // figure out first and last days of the month      var firstDate = new Date( newYear, newMonth, 1 );   var firstDayOfWeek = firstDate.getDay() - Offset;   if( firstDayOfWeek < 0 )      firstDayOfWeek+=7;   var lastDayOfMonth = DateUtils.getLastDayOfMonth( newYear, newMonth );      // prepare the dayBoxItemByDateArray, we will be filling this in      this.dayBoxItemByDateArray = new Array();      // loop through all the day boxes      var dayNumber = 1;      for( var dayIndex = 0; dayIndex < this.dayNumberItemArray.length; ++dayIndex )   {      var dayNumberItem = this.dayNumberItemArray[ dayIndex ];      var dayBoxItem = this.dayBoxItemArray[ dayIndex ];            if( dayIndex < firstDayOfWeek || dayNumber > lastDayOfMonth )      {         // this day box is NOT in the month,          dayBoxItem.dayNumber = null;         dayBoxItem.setAttribute( "empty" , "true" );           dayBoxItem.removeAttribute( "weekend" );                  if( dayIndex < firstDayOfWeek )         {            var thisDate = new Date( newYear, newMonth, 1-(firstDayOfWeek - dayIndex ) );                        dayBoxItem.date = thisDate;                        dayNumberItem.setAttribute( "value" , thisDate.getDate() );           }         else         {            var thisDate = new Date( newYear, newMonth, lastDayOfMonth+( dayIndex - lastDayOfMonth - firstDayOfWeek + 1 ) );                        dayBoxItem.date = thisDate;            dayBoxItem.setAttribute( "date", thisDate );            dayNumberItem.setAttribute( "value" , thisDate.getDate() );           }      }        else      {         dayNumberItem.setAttribute( "value" , dayNumber );                  dayBoxItem.removeAttribute( "empty" );          var thisDate = new Date( newYear, newMonth, dayNumber );         if( thisDate.getDay() == 0 | thisDate.getDay() == 6 )         {            dayBoxItem.setAttribute( "weekend", "true" );         }         else            dayBoxItem.removeAttribute( "weekend" );          dayBoxItem.dayNumber = dayNumber;                  this.dayBoxItemByDateArray[ dayNumber ] = dayBoxItem;          ++dayNumber;        }   }     // if we aren't showing an event, highlite the selected date.   if ( this.calendarWindow.EventSelection.selectedEvents.length < 1 )    {      this.hiliteSelectedDate( );   }      //always highlight today's date.   this.hiliteTodaysDate( );}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/76b784fca4394a565ab5193c3d63c72fbff3d57a/monthView.js/clean/calendar/resources/content/monthView.js