From ec6cd37f9304e31409c45761db17bb106afdd033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AD=B1=E9=87=8E?= Date: Sat, 13 Sep 2025 11:21:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E4=B8=8E=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- babel.config.js | 3 --- src/components/Picker/CalendarDialog/DialogCalendarCard.tsx | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/babel.config.js b/babel.config.js index a5e466f..ca1302e 100644 --- a/babel.config.js +++ b/babel.config.js @@ -49,8 +49,5 @@ module.exports = { 'nutui-react', ], ], - - - ], } diff --git a/src/components/Picker/CalendarDialog/DialogCalendarCard.tsx b/src/components/Picker/CalendarDialog/DialogCalendarCard.tsx index d9695b5..688b432 100644 --- a/src/components/Picker/CalendarDialog/DialogCalendarCard.tsx +++ b/src/components/Picker/CalendarDialog/DialogCalendarCard.tsx @@ -50,7 +50,9 @@ const DialogCalendarCard: React.FC = ({ const minute = value[1] as number setSelectedHour(hour) setSelectedMinute(minute) - const finalDate = new Date(dayjs(selected).format('YYYY-MM-DD') + ' ' + hour + ':' + minute) + const hours = hour.toString().padStart(2, '0') + const minutes = minute.toString().padStart(2, '0') + const finalDate = new Date(dayjs(selected).format('YYYY-MM-DD') + ' ' + hours + ':' + minutes) if (onChange) onChange(finalDate) } onClose() @@ -101,6 +103,7 @@ const DialogCalendarCard: React.FC = ({ } }, [type, pendingJump]) + console.log([selectedHour, selectedMinute], 'selectedHour, selectedMinute'); return (