rem: var yearStart = new Date(currentDate.getFullYear(),0,1); var offset = yearStart.getDay(); if (offset > 3) offset -= 4; else offset+=3; var weekNumber = Math.round((((currentDate-yearStart)/86400000)+offset)/7); 
add: var weekNumber = DateUtils.getWeekNumber(currentDate) ; 
context: function printMultiWeekView(currentDate) {var dayStart=currentDate.getDate();var dowStart = (startOfWeek <= currentDate.getDay()) ?  currentDate.getDay()-startOfWeek : 7-startOfWeek;var weekStart=new Date(currentDate.getFullYear(), currentDate.getMonth(), dayStart - dowStart - (prevWeeksInView*7));var printwindow=window.open("","printwindow");printwindow.document.open();printwindow.document.write("<html><head><title>"+windowTitle+"</title></head><body style='font-size:11px;'>");var mytitle=document.getElementById("title-field").value;if (mytitle.length > 0)  {    printwindow.document.write("<table border=0 width=100% style='font-size:26px;font-weight:bold;'><tr><td valign=bottom align=center>");    printwindow.document.write(mytitle);    printwindow.document.write("</td></tr></table>");  }var yearStart = new Date(currentDate.getFullYear(),0,1);var offset = yearStart.getDay();if (offset > 3)   offset -= 4;else   offset+=3;var weekNumber = Math.round((((currentDate-yearStart)/86400000)+offset)/7);printwindow.document.write("<table border=0 width=100% style='font-size:26px;font-weight:bold;'><tr ><td align=center valign=bottom>Week "+weekNumber+"</td></tr></table>");printwindow.document.write("<table style='border:1px solid black;' width=100%>")printwindow.document.write("<tr>");printwindow.document.write("<td align=center style='border:1px solid black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT: bold'>"+ArrayOfDayNames[weekStart.getDay()]+"</td>");printwindow.document.write("<td align=center style='border:1px solid black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT: bold'>"+ArrayOfDayNames[(weekStart.getDay()+1 >6) ? weekStart.getDay()+1-7:weekStart.getDay()+1]+"</td>");printwindow.document.write("<td align=center style='border:1px solid black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT: bold'>"+ArrayOfDayNames[(weekStart.getDay()+2 >6) ? weekStart.getDay()+2-7:weekStart.getDay()+2]+"</td>");printwindow.document.write("<td align=center style='border:1px solid black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT: bold'>"+ArrayOfDayNames[(weekStart.getDay()+3 >6) ? weekStart.getDay()+3-7:weekStart.getDay()+3]+"</td>");printwindow.document.write("<td align=center style='border:1px solid black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT: bold'>"+ArrayOfDayNames[(weekStart.getDay()+4 >6) ? weekStart.getDay()+4-7:weekStart.getDay()+4]+"</td>");printwindow.document.write("<td align=center style='border:1px solid black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT: bold'>"+ArrayOfDayNames[(weekStart.getDay()+5 >6) ? weekStart.getDay()+5-7:weekStart.getDay()+5]+"</td>");printwindow.document.write("<td align=center style='border:1px solid black;background-color:#e0e0e0;FONT-SIZE:12px;FONT-WEIGHT: bold'>"+ArrayOfDayNames[(weekStart.getDay()+6 >6) ? weekStart.getDay()+6-7:weekStart.getDay()+6]+"</td>");printwindow.document.write("</tr>");// content heredayToStart=weekStart.getDate();monthToStart=weekStart.getMonth();yearToStart=weekStart.getFullYear();var showprivate=document.getElementById("private-checkbox");for (var w=0; w<weeksInView; w++){printwindow.document.write("<tr>");for (var i=0; i<7; i++){   var thisDaysDate=new Date(yearToStart, monthToStart, dayToStart+i+(w*7));   printwindow.document.write("<td style='border:1px solid black;' valign=top width=14%>");   printwindow.document.write("<table valign=top height=100 width=100% border=0>");   printwindow.document.write("<tr valign=top><td colspan=2 align=center valign=top >");   printwindow.document.write(monthNames[thisDaysDate.getMonth()].substring(0,3)+" "+thisDaysDate.getDate());   printwindow.document.write("</td></tr>");   printwindow.document.write("<tr valign=top><td valign=top width=20%></td><td valign=top width=80%></td></tr>");   var calendarEventDisplay   // add each calendarEvent   dayEventList = eventSource.getEventsForDay( thisDaysDate );   for( var eventIndex = 0; eventIndex < dayEventList.length; eventIndex++ )         {              calendarEventDisplay = dayEventList[ eventIndex ];              var listpriv=true;              if (calendarEventDisplay.event.privateEvent)                if (! showprivate.checked)                  listpriv=false;              if (listpriv)              {                     eventTitle=calendarEventDisplay.event.title;                     var eventStartTime = new Date( calendarEventDisplay.event.start.getTime() ) ;                     var formattedStartTime=returnTime(eventStartTime);                     var eventEndTime = new Date( calendarEventDisplay.event.end.getTime() ) ;                     var formattedEndTime=returnTime(eventEndTime);                     var formattedTime=formattedStartTime+"-"+formattedEndTime;                     if (calendarEventDisplay.event.allDay)                        formattedTime=''; // all day event                     if (calendarEventDisplay.event.allDay)                        printwindow.document.write("<tr valign=top><td valign=top colspan=2 style='font-size:11px;'>");                     else                        printwindow.document.write("<tr valign=top><td valign=top colspan=2 style='font-size:11px;'>"+formattedTime+"</td></tr><tr><td></td><td valign=top style='font-size:11px;'>");                     printwindow.document.write(eventTitle);                     if (calendarEventDisplay.event.location)                         printwindow.document.write("</td></tr><tr valign=top><td></td><td valign=top style='font-size:11px;'>"+locationTag+": "+calendarEventDisplay.event.location);                     if (calendarEventDisplay.event.url)                         printwindow.document.write("</td></tr><tr valign=top><td></td><td valign=top style='font-size:11px;'>"+uriTag+": "+calendarEventDisplay.event.url);                     printwindow.document.write("</td></tr>");              }       }    printwindow.document.write("</table>");}printwindow.document.write("</tr>");} // end of all weeksprintwindow.document.write("</table>")printwindow.document.write("</body></html>");printwindow.document.close();}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/f329c8a359144429855eaf9d3c5261f5b3347d88/printDialog.js/buggy/calendar/resources/content/printDialog.js