Skip to content

Commit

Permalink
fix: duration plugin getter get result 0 instead of undefined add test
Browse files Browse the repository at this point in the history
  • Loading branch information
iamkun committed Jul 10, 2023
1 parent 958b2bb commit 3abacc0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugin/duration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class Duration {
} else {
base = this.$d[pUnit]
}
return !base ? 0 : base // a === 0 will be true on both 0 and -0
return base || 0 // a === 0 will be true on both 0 and -0
}

add(input, unit, isSubtract) {
Expand Down

0 comments on commit 3abacc0

Please sign in to comment.