Remove unneeded polyfill

All browsers already have native support for it.
This commit is contained in:
Chocobo1 2024-02-19 14:08:28 +08:00
parent 9192c988ed
commit e1fa7e01c6

View file

@ -137,33 +137,6 @@ window.qBittorrent.Misc = (function() {
return parseFloat(value).toFixed(precision); return parseFloat(value).toFixed(precision);
}; };
/*
* From: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
*/
if (!Date.prototype.toISOString) {
(function() {
function pad(number) {
if (number < 10) {
return '0' + number;
}
return number;
}
Date.prototype.toISOString = function() {
return this.getUTCFullYear()
+ '-' + pad(this.getUTCMonth() + 1)
+ '-' + pad(this.getUTCDate())
+ 'T' + pad(this.getUTCHours())
+ ':' + pad(this.getUTCMinutes())
+ ':' + pad(this.getUTCSeconds())
+ '.' + (this.getUTCMilliseconds() / 1000).toFixed(3).slice(2, 5)
+ 'Z';
};
}());
}
/* /*
* JS counterpart of the function in src/misc.cpp * JS counterpart of the function in src/misc.cpp
*/ */