Changed comparison to highlight selected date, fixes #5676 (DatePicker Dialog defaultDate incorrect behaviour)

This commit is contained in:
Alberto Fernández Capel 2010-06-13 19:00:04 +08:00 committed by Richard D. Worth
parent aa416fcfd9
commit eb13c01722

View File

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