Browse Source

fix(timeline): #2795 fix date for custom format function (#2826)

* Fix #2795 issue
dependencies
Marco Schnüriger 7 years ago
committed by Uli Fahrer
parent
commit
659af5805b
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      lib/timeline/TimeStep.js

+ 7
- 1
lib/timeline/TimeStep.js View File

@ -521,6 +521,9 @@ TimeStep.prototype.getLabelMinor = function(date) {
if (date == undefined) {
date = this.current;
}
if (date instanceof Date) {
date = this.moment(date)
}
if (typeof(this.format.minorLabels) === "function") {
return this.format.minorLabels(date, this.scale, this.step);
@ -540,7 +543,10 @@ TimeStep.prototype.getLabelMajor = function(date) {
if (date == undefined) {
date = this.current;
}
if (date instanceof Date) {
date = this.moment(date)
}
if (typeof(this.format.majorLabels) === "function") {
return this.format.majorLabels(date, this.scale, this.step);
}

Loading…
Cancel
Save