aboutsummaryrefslogtreecommitdiff
path: root/src/duration.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/duration.ts')
-rw-r--r--src/duration.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/duration.ts b/src/duration.ts
index ebd270d..cb25107 100644
--- a/src/duration.ts
+++ b/src/duration.ts
@@ -15,9 +15,9 @@ export class Duration {
this.unit = unit
}
- isValid() { return moment.duration(this.value, this.unit).isValid(); }
+ isValid() { return moment.duration(parseInt(this.value), this.unit).isValid(); }
toMoment() {
- let m = moment.duration(this.value, this.unit);
+ let m = moment.duration(parseInt(this.value), this.unit);
if (m.isValid()) return m;
return null;
}