From d7cf477d31f6db07095c55dda1b65292aed87d32 Mon Sep 17 00:00:00 2001 From: DarkPhoenix2704 Date: Wed, 30 Oct 2024 08:55:26 +0000 Subject: [PATCH] fix: Calendar current time cursor is in the wrong place --- .../smartsheet/calendar/DayView/DateTimeField.vue | 6 +++--- .../smartsheet/calendar/WeekView/DateTimeField.vue | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue b/packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue index 90c6ca3169..7435e35a84 100644 --- a/packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue +++ b/packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue @@ -67,7 +67,7 @@ const overlayTop = computed(() => { const minutes = currTime.value.minute() + currTime.value.hour() * 60 - const top = (perRecordHeight / 60) * minutes + const top = (perRecordHeight / 60) * minutes - 9 return top }) @@ -921,9 +921,9 @@ watch(
- {{ dayjs().format('hh:mm A') }} + {{ currTime.format('hh:mm A') }}
diff --git a/packages/nc-gui/components/smartsheet/calendar/WeekView/DateTimeField.vue b/packages/nc-gui/components/smartsheet/calendar/WeekView/DateTimeField.vue index d40044ff0d..71de7449db 100644 --- a/packages/nc-gui/components/smartsheet/calendar/WeekView/DateTimeField.vue +++ b/packages/nc-gui/components/smartsheet/calendar/WeekView/DateTimeField.vue @@ -76,7 +76,7 @@ const overlayStyle = computed(() => { const left = (containerWidth.value / maxVisibleDays.value) * getDayIndex(currTime.value) const minutes = currTime.value.hour() * 60 + currTime.value.minute() - const top = (52 / 60) * minutes + const top = (52 / 60) * minutes - 12 return { width: `${containerWidth.value / maxVisibleDays.value}px`, @@ -965,7 +965,7 @@ watch( class="text-brand-500 rounded-md text-xs border-1 pointer-events-auto px-0.5 border-brand-200 cursor-pointer bg-brand-50" @click="addRecord(dayjs())" > - {{ dayjs().format('hh:mm A') }} + {{ currTime.format('hh:mm A') }}