From 1a4d2770d814e2a12aeb73ff394bd0770008dc7d Mon Sep 17 00:00:00 2001 From: Derrick <547791743@qq.com> Date: Thu, 10 Nov 2022 18:17:13 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A024=E7=82=B9=E7=9A=84?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/panels/TimePanel/TimeBody.tsx | 8 +++++++- src/panels/TimePanel/index.tsx | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/panels/TimePanel/TimeBody.tsx b/src/panels/TimePanel/TimeBody.tsx index 186182a4e..fa892c9fa 100644 --- a/src/panels/TimePanel/TimeBody.tsx +++ b/src/panels/TimePanel/TimeBody.tsx @@ -68,6 +68,7 @@ function TimeBody(props: TimeBodyProps) { disabledTime, hideDisabledOptions, onSelect, + format, } = props; // Misc @@ -126,7 +127,12 @@ function TimeBody(props: TimeBodyProps) { }; // ========================= Unit ========================= - const rawHours = generateUnits(0, 23, hourStep, mergedDisabledHours && mergedDisabledHours()); + const rawHours = generateUnits( + format?.includes('k') ? 1 : 0, + format?.includes('k') ? 24 : 23, + hourStep, + mergedDisabledHours && mergedDisabledHours() + ); const memorizedRawHours = useMemo(() => rawHours, rawHours, shouldUnitsUpdate); diff --git a/src/panels/TimePanel/index.tsx b/src/panels/TimePanel/index.tsx index 8025a3a14..65556aedb 100644 --- a/src/panels/TimePanel/index.tsx +++ b/src/panels/TimePanel/index.tsx @@ -92,6 +92,7 @@ function TimePanel(props: TimePanelProps) {