WIP Начала изменение календаря
This commit is contained in:
@@ -39,9 +39,15 @@
|
||||
transition-show="scale",
|
||||
transition-hide="scale"
|
||||
self="top middle",
|
||||
:offset="[118, 14]"
|
||||
:offset="[122, 14]"
|
||||
)
|
||||
base-calendar(v-model="date", range, :range-count="7")
|
||||
base-calendar(
|
||||
v-model="date",
|
||||
range,
|
||||
:range-count="7",
|
||||
:save="saveNewDate",
|
||||
:cancel="cancelDateChanges"
|
||||
)
|
||||
q-btn(
|
||||
color="secondary",
|
||||
icon="arrow_forward_ios",
|
||||
@@ -111,17 +117,25 @@ export default {
|
||||
...mapActions({
|
||||
changeSelectedDates: "changeSelectedDates",
|
||||
}),
|
||||
saveNewDate() {
|
||||
this.calendarVisibility = false;
|
||||
if (
|
||||
!this.date?.from.isSame(this.selectedDates?.from) &&
|
||||
!this.date?.to.isSame(this.selectedDates?.to)
|
||||
)
|
||||
this.changeSelectedDates(this.date);
|
||||
},
|
||||
cancelDateChanges() {
|
||||
this.calendarVisibility = false;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
date: {
|
||||
deep: true,
|
||||
handler(val) {
|
||||
if (
|
||||
!this.date?.from.isSame(this.selectedDates?.from) &&
|
||||
!this.date?.to.isSame(this.selectedDates?.to)
|
||||
)
|
||||
this.changeSelectedDates(val);
|
||||
},
|
||||
calendarVisibility(val) {
|
||||
if (val === false)
|
||||
this.date = {
|
||||
from: this.selectedDates.from.clone(),
|
||||
to: this.selectedDates.to.clone(),
|
||||
};
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
|
||||
Reference in New Issue
Block a user