rem: else { if(dayIndex == firstDayOfMonthIndex) { titleMonth = this.calendarWindow.dateFormater.getShortMonthName(selectedDateMonth); this.dayNumberItemArray[ dayIndex ].setAttribute( "value" , thisDate.getDate()+" "+titleMonth ); this.dayNumberItemArray[ dayIndex ].setAttribute( "withmonth","true" ); }  if( thisDate.getDay() == 0 | thisDate.getDay() == 6 ) { dayBoxItem.setAttribute( "weekend", "true" ); } else { dayBoxItem.removeAttribute( "weekend" ); } }  
context: MultiweekView.prototype.refreshDisplayFromDate = function multiweekView_refreshDisplayFromDate(startDate) {   // figure out first and last days of the month, first and last date of view  this.firstDateOfView = startDate;  this.lastDateOfView = new Date( startDate.getFullYear(), startDate.getMonth(), startDate.getDate() + this.WeeksInView*7 - 1, 23, 59, 59 );  // set the year in the header (top-left)  document.getElementById( "multiweek-title" ).setAttribute( "value" , startDate.getFullYear() );  // 'current month' defined by current selectedDate, used to color days in grid  var selectedDate = this.calendarWindow.getSelectedDate();  var selectedDateYear = selectedDate.getFullYear();  var selectedDateMonth = selectedDate.getMonth();  var firstDayOfMonth  = new Date( selectedDateYear, selectedDateMonth, 1 );   var firstDayOfMonthIndex = this.indexOfDate( firstDayOfMonth );  var lastDayOfMonth = DateUtils.getLastDayOfMonth( selectedDateYear, selectedDateMonth );  var lastDayOfMonthDate  = new Date( selectedDateYear, selectedDateMonth, lastDayOfMonth );   var lastDayOfMonthIndex = this.indexOfDate( lastDayOfMonthDate );  var weekDayOffset = this.preferredWeekStart();  var isOnlyWorkDays = (gOnlyWorkdayChecked == "true");  var isDayOff = (isOnlyWorkDays? this.preferredDaysOff() : null);     // hide or unhide columns for days off  for(var day = 0; day < 7; day++) {    var col = ((7 - weekDayOffset + day) % 7) + 1;    if( isOnlyWorkDays && isDayOff[day])      document.getElementById( "multiweek-view-column-"+col ).setAttribute( "collapsed", "true" );    else       document.getElementById( "multiweek-view-column-"+col ).removeAttribute( "collapsed" );  }   if( isOnlyWorkDays ) {     //Is firstDayOfMonth and firstDayOfNextMonth during a weekend ?     //If so we change the firstDayOfMonthIndex to the first day displayed     var firstOfMonthWeekDay = firstDayOfMonth.getDay();     for (var addDays = 0; addDays < 7; addDays++) {       var weekDay = (7 - weekDayOffset + firstOfMonthWeekDay + addDays) % 7;       if (!isDayOff[weekDay]) {	 firstDayOfMonthIndex += addDays;	 break;       }     }   }   // To Set Week Number    var weekNumberItem;   var weekNumber ;   var mondayDate ;   var mondayOffset = (weekDayOffset >= 5) ? 8 - weekDayOffset : 1 - weekDayOffset ;   for(var weekIndex = 0; weekIndex < this.WeeksInView; ++weekIndex )   {     weekNumberItem = this.weekNumberItemArray[ weekIndex+1 ] ;     mondayDate = new Date( this.firstDateOfView.getFullYear(), 			    this.firstDateOfView.getMonth(),			    this.firstDateOfView.getDate()+mondayOffset+7*weekIndex );     weekNumber=DateUtils.getWeekNumber(mondayDate);     weekNumberItem.setAttribute( "value" , weekNumber );       //document.getElementById( "multiweek-sb-row" + (weekIndex+1) ).setAttribute( "collapsed","true");   }   //document.getElementById( "multiweek-sb-row" + this.WeeksInView).removeAttribute( "collapsed");   // Write in all the day numbers   var dayNumberItem ;   var dayBoxItem ;   var thisDate = new Date();   var startYear = startDate.getFullYear();   var startMonth = startDate.getMonth();   var startDayOfMonth = startDate.getDate();   // loop through all the day boxes   for( var dayIndex = 0; dayIndex < this.dayNumberItemArray.length; ++dayIndex )   {          dayNumberItem = this.dayNumberItemArray[ dayIndex ];     dayBoxItem = this.dayBoxItemArray[ dayIndex ];     thisDate = new Date( startYear, startMonth, startDayOfMonth + dayIndex );      dayBoxItem.removeAttribute( "empty" );       dayNumberItem.removeAttribute( "withmonth" );      dayNumberItem.setAttribute( "value" , thisDate.getDate() );      dayBoxItem.setAttribute( "date", thisDate );      dayBoxItem.date = thisDate;       if( dayIndex < firstDayOfMonthIndex || dayIndex > lastDayOfMonthIndex )      {         // this day box is NOT in the month,          dayBoxItem.setAttribute( "empty" , "true" );           dayBoxItem.removeAttribute( "weekend" );	 if(dayIndex == lastDayOfMonthIndex + 1) 	   {	     titleMonth = this.calendarWindow.dateFormater.getShortMonthName(thisDate.getMonth());	     this.dayNumberItemArray[ dayIndex ].setAttribute( "value" , thisDate.getDate()+" "+titleMonth );	     this.dayNumberItemArray[ dayIndex ].setAttribute( "withmonth","true" );	   }      }      else 	{	  if(dayIndex == firstDayOfMonthIndex) 	    {	      titleMonth = this.calendarWindow.dateFormater.getShortMonthName(selectedDateMonth);	      this.dayNumberItemArray[ dayIndex ].setAttribute( "value" , thisDate.getDate()+" "+titleMonth );	      this.dayNumberItemArray[ dayIndex ].setAttribute( "withmonth","true" );	    }	  	  if( thisDate.getDay() == 0 | thisDate.getDay() == 6 )	    { dayBoxItem.setAttribute( "weekend", "true" ); }	  else	    { dayBoxItem.removeAttribute( "weekend" ); }	}     }   //Modification for the first day of view   thisDate = new Date( startYear, startMonth, startDayOfMonth );   var titleMonth = this.calendarWindow.dateFormater.getShortMonthName(thisDate.getMonth());   this.dayNumberItemArray[ 0 ].setAttribute( "value" , thisDate.getDate()+" "+titleMonth );   this.dayNumberItemArray[ 0 ].setAttribute( "withmonth","true" );   // 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: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/21f68350360a34797840d29da57fa59e5991f47f/multiweekView.js/clean/calendar/resources/content/multiweekView.js