Use the last picked date as reference for the date panel
This commit is contained in:
parent
2332ac9bff
commit
02859de9b1
2 changed files with 7 additions and 2 deletions
|
@ -92,7 +92,11 @@
|
||||||
mixins: [ Mixin, Locale, DateMixin ],
|
mixins: [ Mixin, Locale, DateMixin ],
|
||||||
components: { Icon, DateTable, YearTable, MonthTable, TimePicker, Confirm, datePanelLabel },
|
components: { Icon, DateTable, YearTable, MonthTable, TimePicker, Confirm, datePanelLabel },
|
||||||
props: {
|
props: {
|
||||||
// in the mixin
|
// more props in the mixin
|
||||||
|
multiple: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
const {selectionMode, value} = this;
|
const {selectionMode, value} = this;
|
||||||
|
@ -141,7 +145,7 @@
|
||||||
watch: {
|
watch: {
|
||||||
value (newVal) {
|
value (newVal) {
|
||||||
this.dates = newVal;
|
this.dates = newVal;
|
||||||
this.panelDate = this.startDate || this.dates[0] || new Date();
|
this.panelDate = this.startDate || (this.multiple ? this.dates[this.dates.length - 1] : this.dates[0]) || new Date();
|
||||||
},
|
},
|
||||||
currentView (currentView) {
|
currentView (currentView) {
|
||||||
this.$emit('on-selection-mode-change', currentView);
|
this.$emit('on-selection-mode-change', currentView);
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
:split-panels="splitPanels"
|
:split-panels="splitPanels"
|
||||||
:show-week-numbers="showWeekNumbers"
|
:show-week-numbers="showWeekNumbers"
|
||||||
:picker-type="type"
|
:picker-type="type"
|
||||||
|
:multiple="multiple"
|
||||||
|
|
||||||
:time-picker-options="timePickerOptions"
|
:time-picker-options="timePickerOptions"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue