From a0b40e4eae389d055a4942b59fce36cfad728528 Mon Sep 17 00:00:00 2001 From: DarkPhoenix2704 Date: Tue, 20 Feb 2024 07:16:09 +0000 Subject: [PATCH] fix(nc-gui): include tz in filters --- .../calendar/DayView/DateTimeField.vue | 6 +++--- .../nc-gui/composables/useCalendarViewStore.ts | 18 ++++-------------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue b/packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue index b173205111..1edf8b549f 100644 --- a/packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue +++ b/packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue @@ -63,11 +63,11 @@ const recordsAcrossAllRange = computed(() => { if (!startDate.isValid() || startDate.isAfter(endDate)) continue - if (startDate.isBefore(scheduleStart)) { + if (startDate.isBefore(scheduleStart, 'minutes')) { startDate = scheduleStart } - if (endDate.isAfter(scheduleEnd)) { + if (endDate.isAfter(scheduleEnd, 'minutes')) { endDate = scheduleEnd } @@ -88,7 +88,7 @@ const recordsAcrossAllRange = computed(() => { overlaps[startMinutes].push(id) startMinutes += 15 } - const finalTopInPixels = topInPixels + startHour + const finalTopInPixels = topInPixels + 5 + startHour * 2 const style: Partial = { top: `${finalTopInPixels}px`, diff --git a/packages/nc-gui/composables/useCalendarViewStore.ts b/packages/nc-gui/composables/useCalendarViewStore.ts index 6c1a17e533..bcd7bd7b03 100644 --- a/packages/nc-gui/composables/useCalendarViewStore.ts +++ b/packages/nc-gui/composables/useCalendarViewStore.ts @@ -181,13 +181,8 @@ const [useProvideCalendarViewStore, useCalendarViewStore] = useInjectionState( break } - if (calDataType.value === UITypes.Date) { - fromDate = dayjs(fromDate).format('YYYY-MM-DDZ') - toDate = dayjs(toDate).format('YYYY-MM-DDZ') - } else if (calDataType.value === UITypes.DateTime) { - fromDate = dayjs(fromDate).format('YYYY-MM-DD HH:mm:ssZ') - toDate = dayjs(toDate).format('YYYY-MM-DD HH:mm:ssZ') - } + fromDate = dayjs(fromDate).format('YYYY-MM-DD HH:mm:ssZ') + toDate = dayjs(toDate).format('YYYY-MM-DD HH:mm:ssZ') calendarRange.value.forEach((range) => { const fromCol = range.fk_from_col @@ -352,13 +347,8 @@ const [useProvideCalendarViewStore, useCalendarViewStore] = useInjectionState( break } - if (calDataType.value === UITypes.Date) { - fromDate = dayjs(fromDate).format('YYYY-MM-DDZ') - toDate = dayjs(toDate).format('YYYY-MM-DDZ') - } else if (calDataType.value === UITypes.DateTime) { - fromDate = dayjs(fromDate).format('YYYY-MM-DD HH:mm:ssZ') - toDate = dayjs(toDate).format('YYYY-MM-DD HH:mm:ssZ') - } + fromDate = dayjs(fromDate).format('YYYY-MM-DD HH:mm:ssZ') + toDate = dayjs(toDate).format('YYYY-MM-DD HH:mm:ssZ') calendarRange.value.forEach((range) => { const fromCol = range.fk_from_col