Skip to content

Commit

Permalink
fix: Fix UTC plugin add day DST bug
Browse files Browse the repository at this point in the history
fix #586
  • Loading branch information
iamkun committed May 7, 2019
1 parent de14682 commit 549fe00
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,8 @@ class Dayjs {
number = Number(number) // eslint-disable-line no-param-reassign
const unit = Utils.p(units)
const instanceFactorySet = (n) => {
const date = new Date(this.$d)
date.setDate(date.getDate() + Math.round(n * number))
return Utils.w(date, this)
const d = dayjs(this)
return Utils.w(d.date(d.date() + Math.round(n * number)), this)
}
if (unit === C.M) {
return this.set(C.M, this.$M + number)
Expand Down

0 comments on commit 549fe00

Please sign in to comment.