From 84ddeb74a1a69af3c248dde0f0f1e65a185ca863 Mon Sep 17 00:00:00 2001 From: Daria Golova Date: Tue, 27 Dec 2022 14:43:15 +0300 Subject: [PATCH] =?UTF-8?q?WIP=20=D0=9E=D0=B1=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=B0=D0=BD=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B8=20=D0=BE=D1=87=D0=B8=D1=81=D1=82=D0=BA?= =?UTF-8?q?=D0=B5=20=D0=B2=20inputDate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/base/BaseInputDate.vue | 2 +- .../calendar/components/CalendarFormAddEvent.vue | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/base/BaseInputDate.vue b/src/components/base/BaseInputDate.vue index 902f13c..04d2813 100644 --- a/src/components/base/BaseInputDate.vue +++ b/src/components/base/BaseInputDate.vue @@ -28,7 +28,7 @@ export default { return this.modelValue?.toISOString().split("T")[0]; }, set(value) { - this.$emit("update:modelValue", new Date(value)); + this.$emit("update:modelValue", value ? new Date(value) : null); }, }, }, diff --git a/src/pages/calendar/components/CalendarFormAddEvent.vue b/src/pages/calendar/components/CalendarFormAddEvent.vue index 1960dc1..79326fd 100644 --- a/src/pages/calendar/components/CalendarFormAddEvent.vue +++ b/src/pages/calendar/components/CalendarFormAddEvent.vue @@ -40,7 +40,7 @@ .flex.gap-x-2 .flex.flex-col(class="gap-y-1.5") span.text-xxs.opacity-40.font-bold.leading-3.font-bold Дата - base-input-date.h-10(v-model:value="eventDate") + base-input-date.h-10(v-model="eventDate") .flex.gap-x-2.items-center .flex.flex-col(class="gap-y-1.5") span.text-xxs.opacity-40.font-bold.leading-3.font-bold Начало @@ -130,7 +130,7 @@ export default { endTime: "", members: {}, employees: {}, - eventDate: "", + eventDate: Date, status: {}, id: null, ifClearedForm: true, @@ -206,13 +206,13 @@ export default { }, startDate() { return this.selectedEventData.start - ? moment.parseZone(this.selectedEventData.start) - : this.currentDate; + ? new Date(this.selectedEventData.start) + : this.currentDate.toDate(); }, endDate() { return this.selectedEventData.end - ? moment.parseZone(this.selectedEventData.end) - : this.currentDate; + ? new Date(this.selectedEventData.end) + : this.currentDate.toDate(); }, eventEmployee() { if (this.selectedEventData.employees) { @@ -558,7 +558,7 @@ export default { handler(newDate) { if (newDate) { this.eventDate = newDate; - this.startTime = newDate.format("HH:mm"); + this.startTime = moment(newDate).format("HH:mm"); } }, }, @@ -566,7 +566,7 @@ export default { immediate: true, handler(newDate) { if (newDate) { - this.endTime = newDate.format("HH:mm"); + this.endTime = moment(newDate).format("HH:mm"); } }, },