vendor/assets/vis/timeline/component/TimeAxis.js in vis-rails-0.0.4 vs vendor/assets/vis/timeline/component/TimeAxis.js in vis-rails-0.0.5
- old
+ new
@@ -518,5 +518,15 @@
}
else {
this.conversion = Range.conversion(range.start, range.end, this.width);
}
};
+
+/**
+ * Snap a date to a rounded value.
+ * The snap intervals are dependent on the current scale and step.
+ * @param {Date} date the date to be snapped.
+ * @return {Date} snappedDate
+ */
+TimeAxis.prototype.snap = function snap (date) {
+ return this.step.snap(date);
+};