From b601833e0dd9af6b8b65ef734a166c9f7a7e8cff Mon Sep 17 00:00:00 2001 From: Yotam Berkowitz Date: Sat, 28 Dec 2019 22:38:35 +0200 Subject: [PATCH] fix: issue #193 (#234) * fix: issue 193 * fix: test --- lib/timeline/TimeStep.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/timeline/TimeStep.js b/lib/timeline/TimeStep.js index b3dfce5a46..945d72fdd9 100644 --- a/lib/timeline/TimeStep.js +++ b/lib/timeline/TimeStep.js @@ -34,7 +34,7 @@ class TimeStep { * @constructor TimeStep */ constructor(start, end, minimumStep, hiddenDates, options) { - this.moment = moment; + this.moment = (options && options.moment) || moment; // variables this.current = this.moment(); @@ -165,7 +165,7 @@ class TimeStep { default: break; } if (!priorCurrent.isSame(this.current)) { - this.current = moment(DateUtil.snapAwayFromHidden(this.hiddenDates, this.current.valueOf(), -1, true)); + this.current = this.moment(DateUtil.snapAwayFromHidden(this.hiddenDates, this.current.valueOf(), -1, true)); } } }