Checked in patch for bug 258527:

MonthView, workweek only: no 5th week if month ends on day off at 6th week start
This commit is contained in:
mostafah%oeone.com 2004-09-09 14:42:42 +00:00
parent bbf0339719
commit 2a4f93fd10

View File

@ -520,7 +520,8 @@ MonthView.prototype.refreshDisplay = function monthView_refreshDisplay( )
}
{ // sixth week should not display if holds only off days and only work days displayed
var isSixthWeekDisplayed = (firstDateCol + lastDayOfMonth > 5 * 7);
var monthHasSixthWeek = (firstDateCol + lastDayOfMonth > 5 * 7);
var isSixthWeekDisplayed = monthHasSixthWeek;
if (isSixthWeekDisplayed && isOnlyWorkDays) {
isSixthWeekDisplayed = false;
for (var sixthWeekCol = 0; sixthWeekCol <= lastDateCol; sixthWeekCol++) {
@ -540,7 +541,8 @@ MonthView.prototype.refreshDisplay = function monthView_refreshDisplay( )
var isFifthWeekDisplayed = (firstDateCol + lastDayOfMonth > 4 * 7);
if (isFifthWeekDisplayed && !isSixthWeekDisplayed && isOnlyWorkDays) {
isFifthWeekDisplayed = false;
for (var fifthWeekCol = 0; fifthWeekCol <= lastDateCol; fifthWeekCol++) {
var lastFifthWeekCol = (monthHasSixthWeek? 6 : lastDateCol);
for (var fifthWeekCol = 0; fifthWeekCol <= lastFifthWeekCol; fifthWeekCol++) {
if (!isDayOff[(Offset + fifthWeekCol) % 7]) {
isFifthWeekDisplayed = true;
break;