diff --git a/client/src/components/Planner/DayPlanSidebar.jsx b/client/src/components/Planner/DayPlanSidebar.jsx index cc671e8..9c5d2ef 100644 --- a/client/src/components/Planner/DayPlanSidebar.jsx +++ b/client/src/components/Planner/DayPlanSidebar.jsx @@ -23,7 +23,10 @@ function formatDate(dateStr, locale) { function formatTime(timeStr, locale, timeFormat) { if (!timeStr) return '' try { - const [h, m] = timeStr.split(':').map(Number) + const parts = timeStr.split(':') + const h = Number(parts[0]) || 0 + const m = Number(parts[1]) || 0 + if (isNaN(h)) return timeStr if (timeFormat === '12h') { const period = h >= 12 ? 'PM' : 'AM' const h12 = h === 0 ? 12 : h > 12 ? h - 12 : h diff --git a/client/src/components/Planner/PlaceInspector.jsx b/client/src/components/Planner/PlaceInspector.jsx index 4f2d644..f5b312d 100644 --- a/client/src/components/Planner/PlaceInspector.jsx +++ b/client/src/components/Planner/PlaceInspector.jsx @@ -75,7 +75,10 @@ function convertHoursLine(line, timeFormat) { function formatTime(timeStr, locale, timeFormat) { if (!timeStr) return '' try { - const [h, m] = timeStr.split(':').map(Number) + const parts = timeStr.split(':') + const h = Number(parts[0]) || 0 + const m = Number(parts[1]) || 0 + if (isNaN(h)) return timeStr if (timeFormat === '12h') { const period = h >= 12 ? 'PM' : 'AM' const h12 = h === 0 ? 12 : h > 12 ? h - 12 : h @@ -216,7 +219,7 @@ export default function PlaceInspector({ {place.place_time && (