Skip to content

Commit

Permalink
Try to get IE11 and 20 to take toUTCString fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Xotic750 committed Dec 10, 2015
1 parent 049222e commit 67d99f1
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions es5-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,11 @@ defineProperties(Date.prototype, {
}, hasNegativeMonthYearBug);

if (hasNegativeMonthYearBug || hasToUTCStringFormatBug) {
Date.prototype.toUTCString = function toUTCString() {
delete Date.prototype.toUTCString;
}

defineProperties(Date.prototype, {
toUTCString: function toUTCString() {
if (!this || !(this instanceof Date)) {
throw new TypeError('this is not a Date object.');
}
Expand All @@ -1121,15 +1125,8 @@ if (hasNegativeMonthYearBug || hasToUTCStringFormatBug) {
(hour < 10 ? '0' + hour : hour) + ':' +
(minute < 10 ? '0' + minute : minute) + ':' +
(second < 10 ? '0' + second : second) + ' GMT';
};
if (supportsDescriptors) {
$Object.defineProperty(Date.prototype, 'toUTCString', {
configurable: true,
enumerable: false,
writable: true
});
}
}
}, hasNegativeMonthYearBug || hasToUTCStringFormatBug);

// Opera 12 has `,`
defineProperties(Date.prototype, {
Expand Down

0 comments on commit 67d99f1

Please sign in to comment.