From 506f857dc92344961677457643244a4ff6ec0789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AD=B1=E9=87=8E?= Date: Sat, 18 Oct 2025 21:43:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=8E=86=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NumberInterval/NumberInterval.scss | 1 + src/components/Picker/CalendarUI/CalendarUI.tsx | 3 ++- src/utils/timeUtils.ts | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/components/NumberInterval/NumberInterval.scss b/src/components/NumberInterval/NumberInterval.scss index bce28cc..bf1ee85 100644 --- a/src/components/NumberInterval/NumberInterval.scss +++ b/src/components/NumberInterval/NumberInterval.scss @@ -22,6 +22,7 @@ color: theme.$primary-color; white-space: nowrap; padding-right: 10px; + font-weight: 600; } .participant-control-checkbox-wrapper{ display: flex; diff --git a/src/components/Picker/CalendarUI/CalendarUI.tsx b/src/components/Picker/CalendarUI/CalendarUI.tsx index 10611ff..1835e94 100644 --- a/src/components/Picker/CalendarUI/CalendarUI.tsx +++ b/src/components/Picker/CalendarUI/CalendarUI.tsx @@ -7,6 +7,7 @@ import { getMonth, getWeekend, getWeekendOfCurrentWeek, + getOneMonth } from "@/utils/timeUtils"; import { PopupPicker } from "@/components/Picker/index"; import dayjs from "dayjs"; @@ -165,7 +166,7 @@ const NutUICalendar = React.forwardRef( onChange?.(dayList); }; const selectMonth = () => { - const dayList = getWeekendOfCurrentWeek(30); + const dayList = getOneMonth(); setSelectedValue(dayList); syncMonthTo(dayList[0]); onChange?.(dayList); diff --git a/src/utils/timeUtils.ts b/src/utils/timeUtils.ts index 6bf8e09..5cef7a1 100644 --- a/src/utils/timeUtils.ts +++ b/src/utils/timeUtils.ts @@ -292,4 +292,20 @@ export const calculateDuration = (startTime: string, endTime: string): string => } else { return ""; } +} + + +export const getOneMonth = (): Date[] => { + const dates: Date[] = []; + const currentDate = dayjs(); + const nextMonth = dayjs().add(1, 'month'); + + // 从当前日期开始,遍历到下个月的同一天 + let date = currentDate; + while (date.isBefore(nextMonth) || date.isSame(nextMonth, 'day')) { + dates.push(date.toDate()); + date = date.add(1, 'day'); + } + + return dates; } \ No newline at end of file