diff --git a/lib/date.js b/lib/date.js index 13bcc15..d290698 100644 --- a/lib/date.js +++ b/lib/date.js @@ -43,7 +43,6 @@ if (!Date.prototype.getFullWeek) { if (!Date.prototype.format) { Object.defineProperty(Date.prototype, 'format', { value: function(str) { - str = str || 'Y-m-d H:i:s' var dt = { fullyear: this.getFullYear(), year: this.getYear(), @@ -58,6 +57,7 @@ if (!Date.prototype.format) { } var reg = null + str = str || 'Y-m-d H:i:s' dt.g = dt.hours > 12 ? dt.hours - 12 : dt.hours reg = {