Skip to content

Commit

Permalink
fix: Update duration plugin change string to number (#1394)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszpigula committed Mar 3, 2021
1 parent cb4f746 commit e1546d1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/plugin/duration/index.js
Expand Up @@ -79,15 +79,17 @@ class Duration {
if (typeof input === 'string') {
const d = input.match(durationRegex)
if (d) {
[,,
const properties = d.slice(2)
const numberD = properties.map(value => Number(value));
[
this.$d.years,
this.$d.months,
this.$d.weeks,
this.$d.days,
this.$d.hours,
this.$d.minutes,
this.$d.seconds
] = d
] = numberD
this.calMilliseconds()
return this
}
Expand Down

0 comments on commit e1546d1

Please sign in to comment.