Commit 8d5323069b131d3b73cf119455750956358c9dea
1 parent
7d6ea205
update panel date on every value change
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
src/components/date-picker/panel/Date/date.vue
@@ -116,7 +116,7 @@ | @@ -116,7 +116,7 @@ | ||
116 | ]; | 116 | ]; |
117 | }, | 117 | }, |
118 | panelPickerHandlers(){ | 118 | panelPickerHandlers(){ |
119 | - return this.pickerTable === `${this.currentView}-table` ? this.handlePick : this.handlePreSelection | 119 | + return this.pickerTable === `${this.currentView}-table` ? this.handlePick : this.handlePreSelection; |
120 | }, | 120 | }, |
121 | datePanelLabel () { | 121 | datePanelLabel () { |
122 | const locale = this.t('i.locale'); | 122 | const locale = this.t('i.locale'); |
@@ -140,7 +140,7 @@ | @@ -140,7 +140,7 @@ | ||
140 | watch: { | 140 | watch: { |
141 | value (newVal) { | 141 | value (newVal) { |
142 | this.dates = newVal; | 142 | this.dates = newVal; |
143 | - if (JSON.stringify(newVal) === '[null]') this.panelDate = this.startDate || new Date(); | 143 | + this.panelDate = this.startDate || this.dates[0] || new Date(); |
144 | }, | 144 | }, |
145 | currentView (currentView) { | 145 | currentView (currentView) { |
146 | this.$emit('on-selection-mode-change', currentView); | 146 | this.$emit('on-selection-mode-change', currentView); |