修改时间组件与报错

This commit is contained in:
筱野
2025-09-13 11:21:46 +08:00
parent 52bee95505
commit ec6cd37f93
2 changed files with 4 additions and 4 deletions

View File

@@ -49,8 +49,5 @@ module.exports = {
'nutui-react',
],
],
],
}

View File

@@ -50,7 +50,9 @@ const DialogCalendarCard: React.FC<DialogCalendarCardProps> = ({
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<DialogCalendarCardProps> = ({
}
}, [type, pendingJump])
console.log([selectedHour, selectedMinute], 'selectedHour, selectedMinute');
return (
<CommonPopup