master
宇天 2020-10-27 17:31:08 +08:00
parent 0f18f9f1df
commit 6b89deefc9
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,6 @@ if (!Date.prototype.getFullWeek) {
if (!Date.prototype.format) { if (!Date.prototype.format) {
Object.defineProperty(Date.prototype, 'format', { Object.defineProperty(Date.prototype, 'format', {
value: function(str) { value: function(str) {
str = str || 'Y-m-d H:i:s'
var dt = { var dt = {
fullyear: this.getFullYear(), fullyear: this.getFullYear(),
year: this.getYear(), year: this.getYear(),
@ -58,6 +57,7 @@ if (!Date.prototype.format) {
} }
var reg = null var reg = null
str = str || 'Y-m-d H:i:s'
dt.g = dt.hours > 12 ? dt.hours - 12 : dt.hours dt.g = dt.hours > 12 ? dt.hours - 12 : dt.hours
reg = { reg = {