From fd3c3d0045b9103d34ff4dc6ab0ef68d3c8706b4 Mon Sep 17 00:00:00 2001 From: DarkPhoenix2704 Date: Tue, 20 Feb 2024 07:16:09 +0000 Subject: [PATCH] feat(nc-gui): split date time for week view --- .../calendar/DayView/DateTimeField.vue | 2 +- .../calendar/DayView/RecordCard.vue | 101 ++++ .../smartsheet/calendar/MonthView.vue | 4 +- .../{WeekView.vue => WeekView/DateField.vue} | 27 +- .../calendar/WeekView/DateTimeField.vue | 545 ++++++++++++++++++ .../components/smartsheet/calendar/index.vue | 9 +- 6 files changed, 663 insertions(+), 25 deletions(-) create mode 100644 packages/nc-gui/components/smartsheet/calendar/DayView/RecordCard.vue rename packages/nc-gui/components/smartsheet/calendar/{WeekView.vue => WeekView/DateField.vue} (96%) create mode 100644 packages/nc-gui/components/smartsheet/calendar/WeekView/DateTimeField.vue diff --git a/packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue b/packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue index 1edf8b549f..a6dc3b856d 100644 --- a/packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue +++ b/packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue @@ -92,7 +92,7 @@ const recordsAcrossAllRange = computed(() => { const style: Partial = { top: `${finalTopInPixels}px`, - height: `${heightInPixels - 5}px`, + height: `${heightInPixels}px`, } let position = 'none' diff --git a/packages/nc-gui/components/smartsheet/calendar/DayView/RecordCard.vue b/packages/nc-gui/components/smartsheet/calendar/DayView/RecordCard.vue new file mode 100644 index 0000000000..17de3fe189 --- /dev/null +++ b/packages/nc-gui/components/smartsheet/calendar/DayView/RecordCard.vue @@ -0,0 +1,101 @@ + + + + + diff --git a/packages/nc-gui/components/smartsheet/calendar/MonthView.vue b/packages/nc-gui/components/smartsheet/calendar/MonthView.vue index 26a2560cb2..c43f7fed0c 100644 --- a/packages/nc-gui/components/smartsheet/calendar/MonthView.vue +++ b/packages/nc-gui/components/smartsheet/calendar/MonthView.vue @@ -376,12 +376,12 @@ const onResize = (event: MouseEvent) => { const day = Math.floor(percentX * 7) if (resizeDirection.value === 'right') { - let newEndDate = dates.value[week] ? dayjs(dates.value[week][day]) : null + let newEndDate = dates.value[week] ? dayjs(dates.value[week][day]).endOf('day') : null const updateProperty = [toCol.title] if (dayjs(newEndDate).isBefore(ogStartDate)) { - newEndDate = dayjs(ogStartDate).clone() + newEndDate = dayjs(ogStartDate).clone().endOf('day') } if (!newEndDate) return diff --git a/packages/nc-gui/components/smartsheet/calendar/WeekView.vue b/packages/nc-gui/components/smartsheet/calendar/WeekView/DateField.vue similarity index 96% rename from packages/nc-gui/components/smartsheet/calendar/WeekView.vue rename to packages/nc-gui/components/smartsheet/calendar/WeekView/DateField.vue index ebb14ebc78..2d5f9a3b9c 100644 --- a/packages/nc-gui/components/smartsheet/calendar/WeekView.vue +++ b/packages/nc-gui/components/smartsheet/calendar/WeekView/DateField.vue @@ -1,21 +1,12 @@ + + + + diff --git a/packages/nc-gui/components/smartsheet/calendar/index.vue b/packages/nc-gui/components/smartsheet/calendar/index.vue index 15111d6b81..ebe6dbdfd6 100644 --- a/packages/nc-gui/components/smartsheet/calendar/index.vue +++ b/packages/nc-gui/components/smartsheet/calendar/index.vue @@ -233,8 +233,13 @@ const headerText = computed(() => { @expand-record="expandRecord" @new-record="newRecord" /> - +