mirror of
https://github.com/duplicati/duplicati.git
synced 2025-11-28 11:30:24 +08:00
23 lines
589 B
JavaScript
23 lines
589 B
JavaScript
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';
|
|
};
|
|
|
|
}() );
|
|
}
|