mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-07 04:39:06 +02:00
Support min and max dates on time scale
This commit is contained in:
parent
bfabac945f
commit
35011e5ae3
@ -91,8 +91,17 @@
|
||||
scaleLabelMoments.push(labelMoment);
|
||||
}, this);
|
||||
|
||||
this.firstTick = moment.min.call(this, scaleLabelMoments);
|
||||
this.lastTick = moment.max.call(this, scaleLabelMoments);
|
||||
if (this.options.time.min) {
|
||||
this.firstTick = this.parseTime(this.options.time.min);
|
||||
} else {
|
||||
this.firstTick = moment.min.call(this, scaleLabelMoments);
|
||||
}
|
||||
|
||||
if (this.options.time.max) {
|
||||
this.lastTick = this.parseTime(this.options.time.max);
|
||||
} else {
|
||||
this.lastTick = moment.max.call(this, scaleLabelMoments);
|
||||
}
|
||||
} else {
|
||||
this.firstTick = null;
|
||||
this.lastTick = null;
|
||||
|
Loading…
Reference in New Issue
Block a user