Skip to content

Commit

Permalink
Merge 81ac400 into de0fc75
Browse files Browse the repository at this point in the history
  • Loading branch information
lvzhenbang committed Jul 3, 2019
2 parents de0fc75 + 81ac400 commit 063a640
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/DateUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ const utils = {
* @param {Date} date
*/
setFullYear (date, value, useUtc) {
return this.useUtc ? date.setUTCFullYear(value) : date.setFullYear(value)
return useUtc ? date.setUTCFullYear(value) : (this.useUtc ? date.setUTCFullYear(value) : date.setFullYear(value))
},

/**
* Sets the month, using UTC or not
* @param {Date} date
*/
setMonth (date, value, useUtc) {
return this.useUtc ? date.setUTCMonth(value) : date.setMonth(value)
return return useUtc ? date.setUTCFullYear(value) : (this.useUtc ? date.setUTCMonth(value) : date.setMonth(value))
},

/**
Expand All @@ -75,7 +75,7 @@ const utils = {
* @param {Number} value
*/
setDate (date, value, useUtc) {
return this.useUtc ? date.setUTCDate(value) : date.setDate(value)
return return useUtc ? date.setUTCFullYear(value) : (this.useUtc ? date.setUTCDate(value) : date.setDate(value))
},

/**
Expand Down

0 comments on commit 063a640

Please sign in to comment.