From 8e90850e14228612da98fc4416fa535182b838ae Mon Sep 17 00:00:00 2001 From: Katherine Date: Fri, 28 Mar 2025 18:04:35 +0800 Subject: [PATCH] fix: missing data on boundary dates in weekly calendar view (#6587) --- .../plugin-calendar/src/client/calendar/Calendar.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/Calendar.tsx b/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/Calendar.tsx index 0308569760..604b7de19b 100644 --- a/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/Calendar.tsx +++ b/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/Calendar.tsx @@ -108,7 +108,7 @@ const useEvents = ( title: string; }, date: Date, - view: (typeof Weeks)[number], + view: (typeof Weeks)[number] | any = 'month', ) => { const parseExpression = useLazy( () => import('cron-parser'), @@ -132,8 +132,8 @@ const useEvents = ( const intervalTime = end.diff(start, 'millisecond', true); const dateM = dayjs(date); - const startDate = dateM.clone().startOf('month'); - const endDate = startDate.clone().endOf('month'); + const startDate = dateM.clone().startOf(view); + const endDate = startDate.clone().endOf(view); /** * view === month 时,会显示当月日程 @@ -425,7 +425,6 @@ export const Calendar: any = withDynamicSchemaProps( }; }; const BigCalendar = reactBigCalendar?.BigCalendar; - return wrapSSR(