mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Datepicker: Made the day of year calculator be more accurate. Fixes #6827 - Datepicker: Incorrect value for "oo" during Daylight Saving Time.
This commit is contained in:
parent
463849e4c3
commit
41205cef4b
@ -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
ui/jquery.ui.datepicker.js
vendored
2
ui/jquery.ui.datepicker.js
vendored
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user