Discover: SidebarFilter Timeframes fix startDate & endDate.

This commit is contained in:
chiayin
2023-06-07 12:19:03 +08:00
parent 9a403cce71
commit 8912ce6e8b
5 changed files with 86 additions and 7 deletions

View File

@@ -283,10 +283,10 @@ export default{
// Slider
this.selectArea = [0, this.selectRange];
// Calendar
this.startMinDate = new Date(getMoment(this.filterTimeframe.x_axis.min).startOf('day').local().format());
this.startMaxDate = new Date(getMoment(this.filterTimeframe.x_axis.max).startOf('day').local().format());
this.endMinDate = new Date(getMoment(this.filterTimeframe.x_axis.min).startOf('day').local().format());
this.endMaxDate = new Date(getMoment(this.filterTimeframe.x_axis.max).startOf('day').local().format());
this.startMinDate = new Date(getMoment(this.filterTimeframe.x_axis.min).format());
this.startMaxDate = new Date(getMoment(this.filterTimeframe.x_axis.max).format());
this.endMinDate = new Date(getMoment(this.filterTimeframe.x_axis.min).format());
this.endMaxDate = new Date(getMoment(this.filterTimeframe.x_axis.max).format());
// 讓日曆的範圍等於時間軸的範圍
this.startTime = this.startMinDate;
this.endTime = this.startMaxDate;
@@ -295,8 +295,8 @@ export default{
beforeUnmount() {
this.selectArea = [0, this.selectRange];
this.resizeMask(this.chart);
this.startTime = new Date(getMoment(this.filterTimeframe.x_axis.min).startOf('day').local().format());
this.endTime = new Date(getMoment(this.filterTimeframe.x_axis.max).startOf('day').local().format());
this.startTime = new Date(getMoment(this.filterTimeframe.x_axis.min).format());
this.endTime = new Date(getMoment(this.filterTimeframe.x_axis.max).format());
this.timeFrameStartEnd;
}
}