Skip to content

Commit 8663ef3

Browse files
committed
DatePicker: Replace data() by attr() method to get date information from DOM
1 parent 91b6fc3 commit 8663ef3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ui/widgets/datepicker.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ $.extend( Datepicker.prototype, {
10361036
}
10371037

10381038
inst = this._getInst( target[ 0 ] );
1039-
inst.selectedDay = inst.currentDay = $( "a", td ).html();
1039+
inst.selectedDay = inst.currentDay = parseInt($( "a", td ).attr( "data-date" ));
10401040
inst.selectedMonth = inst.currentMonth = month;
10411041
inst.selectedYear = inst.currentYear = year;
10421042
this._selectDate( id, this._formatDate( inst,
@@ -1816,7 +1816,7 @@ $.extend( Datepicker.prototype, {
18161816
( printDate.getTime() === today.getTime() ? " ui-state-highlight" : "" ) +
18171817
( printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "" ) + // highlight selected day
18181818
( otherMonth ? " ui-priority-secondary" : "" ) + // distinguish dates from other months
1819-
"' href='#'>" + printDate.getDate() + "</a>" ) ) + "</td>"; // display selectable date
1819+
"' href='#' data-date='" + printDate.getDate() + "'>" + printDate.getDate() + "</a>" ) ) + "</td>"; // display selectable date
18201820
printDate.setDate( printDate.getDate() + 1 );
18211821
printDate = this._daylightSavingAdjust( printDate );
18221822
}

0 commit comments

Comments
 (0)