Commit 02859de9b12364ccb6201a026a70ce254053c025

Authored by Sergio Crisostomo
1 parent 2332ac9b

Use the last picked date as reference for the date panel

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);
... ...
src/components/date-picker/picker.vue
... ... @@ -47,6 +47,7 @@
47 47 :split-panels="splitPanels"
48 48 :show-week-numbers="showWeekNumbers"
49 49 :picker-type="type"
  50 + :multiple="multiple"
50 51  
51 52 :time-picker-options="timePickerOptions"
52 53  
... ...