Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions ui/jquery.ui.datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -1562,8 +1562,16 @@ $.extend(Datepicker.prototype, {
var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows
calender += '<tr>';
var tbody = (!showWeek ? '' : '<td class="ui-datepicker-week-col">' +
this._get(inst, 'calculateWeek')(printDate) + '</td>');
var tbody = '';
if (showWeek) { // if the displayed starts and ends in different iso8601 weeks, show both. #8420
var startWeek = this._get(inst, 'calculateWeek')(printDate);
var endDate = new Date(printDate);
endDate.setDate(endDate.getDate() + 6);
endDate = this._daylightSavingAdjust(endDate);
var endWeek = this._get(inst, 'calculateWeek')(endDate);
var weekText = (startWeek === endWeek) ? startWeek : startWeek + "/" + endWeek;
tbody = '<td class="ui-datepicker-week-col">' + weekText + '</td>';
}
for (var dow = 0; dow < 7; dow++) { // create date picker days
var daySettings = (beforeShowDay ?
beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']);
Expand Down