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)); } } }