Commit 02859de9b12364ccb6201a026a70ce254053c025
1 parent
2332ac9b
Use the last picked date as reference for the date panel
Showing
2 changed files
with
7 additions
and
2 deletions
Show diff stats
src/components/date-picker/panel/Date/date.vue
... | ... | @@ -92,7 +92,11 @@ |
92 | 92 | mixins: [ Mixin, Locale, DateMixin ], |
93 | 93 | components: { Icon, DateTable, YearTable, MonthTable, TimePicker, Confirm, datePanelLabel }, |
94 | 94 | props: { |
95 | - // in the mixin | |
95 | + // more props in the mixin | |
96 | + multiple: { | |
97 | + type: Boolean, | |
98 | + default: false | |
99 | + } | |
96 | 100 | }, |
97 | 101 | data () { |
98 | 102 | const {selectionMode, value} = this; |
... | ... | @@ -141,7 +145,7 @@ |
141 | 145 | watch: { |
142 | 146 | value (newVal) { |
143 | 147 | this.dates = newVal; |
144 | - this.panelDate = this.startDate || this.dates[0] || new Date(); | |
148 | + this.panelDate = this.startDate || (this.multiple ? this.dates[this.dates.length - 1] : this.dates[0]) || new Date(); | |
145 | 149 | }, |
146 | 150 | currentView (currentView) { |
147 | 151 | this.$emit('on-selection-mode-change', currentView); | ... | ... |