rem: var thisMonth = startTime.getMonth();  var monthToCompare = thisMonth; 
add: while( monthToCompare == thisMonth ) { startTime = new Date( startTime.getTime() - ( 1000 * 60 * 60 * 24 * 7 ) ); monthToCompare = startTime.getMonth(); weekNumber++; } 
context: function getWeekNumberOfMonth(){   //get the day number for today.   var startTime = document.getElementById( "start-date-picker" ).value;      var oldStartTime = startTime;   var thisMonth = startTime.getMonth();      var monthToCompare = thisMonth;   var weekNumber = 0;   while( monthToCompare == thisMonth )   {      startTime = new Date( startTime.getTime() - ( 1000 * 60 * 60 * 24 * 7 ) );      monthToCompare = startTime.getMonth();            weekNumber++;   }      return( weekNumber );}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/c86bc67709de6872e86b53da8f0162214c37cd97/calPrintEngine.js/buggy/calendar/resources/content/calPrintEngine.js