[Xsltforms-support] Calendar display patch
Brought to you by:
alain-couthures
From: David C. <ot...@cr...> - 2010-04-01 16:53:45
|
There's a display problem with the popup calendar selection when the selected day is the first day of the month, causing the calendar cells corresponding to the previous month's days in the same week to have the "selected" class applied to them. The following patch (also attached in case the inline code is mangled) fixes the problem. - David Index: src/js/controls/Calendar.js.xml =================================================================== --- src/js/controls/Calendar.js.xml (revision 374) +++ src/js/controls/Calendar.js.xml (working copy) @@ -187,13 +187,13 @@ for (var j = 0; j < 7; j++, cont++) { var cell = trLine.childNodes[j]; + var day_in_month = (cont >= firstDay && cont < firstDay + daysOfMonth); Core.setClass(cell, "hover", false); Core.setClass(cell, "today", currentMonthYear && day == this.currentDay); - Core.setClass(cell, "selected", day == this.day); + Core.setClass(cell, "selected", day_in_month && day == this.day); Core.setClass(cell, "weekend", (j+ini)%7 > 4); - cell.firstChild.nodeValue - = (cont >= firstDay && cont < firstDay + daysOfMonth)? day++ : ""; + cell.firstChild.nodeValue = day_in_month ? day++ : ""; } } }; |