Skip to content
Closed
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions tests/unit/datepicker/datepicker_tickets.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@ test('beforeShowDay-getDate', function() {
inp.datepicker('hide');
});

test('Ticket 6827: formatDate day of year calculation is wrong during day lights savings time', function(){
var time = $.datepicker.formatDate("oo", new Date("2010/03/30 12:00:00 CDT"));
equals(time, "089");
});

})(jQuery);
2 changes: 1 addition & 1 deletion ui/jquery.ui.datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ $.extend(Datepicker.prototype, {
break;
case 'o':
output += formatNumber('o',
(date.getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000, 3);
Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
break;
case 'm':
output += formatNumber('m', date.getMonth() + 1, 2);
Expand Down