Datepicker: Hightlight the curerent date, not the selected date. Fixes #5984 - Datepicker showing multiple months highlights selected day in all of them

This commit is contained in:
Lim Chee Aun 2010-09-14 12:33:56 +08:00 committed by Scott González
parent d380099116
commit a936eb3c09

View File

@ -1493,7 +1493,7 @@ $.extend(Datepicker.prototype, {
(otherMonth && !showOtherMonths ? ' ' : // display for other months (otherMonth && !showOtherMonths ? ' ' : // display for other months
(unselectable ? '<span class="ui-state-default">' + printDate.getDate() + '</span>' : '<a class="ui-state-default' + (unselectable ? '<span class="ui-state-default">' + printDate.getDate() + '</span>' : '<a class="ui-state-default' +
(printDate.getTime() == today.getTime() ? ' ui-state-highlight' : '') + (printDate.getTime() == today.getTime() ? ' ui-state-highlight' : '') +
(printDate.getTime() == selectedDate.getTime() ? ' ui-state-active' : '') + // highlight selected day (printDate.getTime() == currentDate.getTime() ? ' ui-state-active' : '') + // highlight selected day
(otherMonth ? ' ui-priority-secondary' : '') + // distinguish dates from other months (otherMonth ? ' ui-priority-secondary' : '') + // distinguish dates from other months
'" href="#">' + printDate.getDate() + '</a>')) + '</td>'; // display selectable date '" href="#">' + printDate.getDate() + '</a>')) + '</td>'; // display selectable date
printDate.setDate(printDate.getDate() + 1); printDate.setDate(printDate.getDate() + 1);