24 lines
501 B
JavaScript
24 lines
501 B
JavaScript
import Amber from 'amber'
|
|
|
|
if (!Date.prototype.toGranite) {
|
|
(function() {
|
|
|
|
function pad(number) {
|
|
if (number < 10) {
|
|
return '0' + number;
|
|
}
|
|
return number;
|
|
}
|
|
|
|
Date.prototype.toGranite = function() {
|
|
return this.getUTCFullYear() +
|
|
'-' + pad(this.getUTCMonth() + 1) +
|
|
'-' + pad(this.getUTCDate()) +
|
|
' ' + pad(this.getUTCHours()) +
|
|
':' + pad(this.getUTCMinutes()) +
|
|
':' + pad(this.getUTCSeconds()) ;
|
|
};
|
|
|
|
}());
|
|
}
|