The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.
TypeScript budget-trackercollaborativedockeritinerarymcp-serveroffline-firstopen-sourceopenstreetmappacking-listpwareal-timeself-hostedselfhostedtraveltravel-apptravel-journaltravel-plannertripitwanderlog
fix: 12h time format input and display in bookings
Mauricece7215341f08
diff --git a/client/src/components/Planner/ReservationsPanel.tsx b/client/src/components/Planner/ReservationsPanel.tsxindex 987ff1842..9bb73c3fd 100644--- a/client/src/components/Planner/ReservationsPanel.tsx+++ b/client/src/components/Planner/ReservationsPanel.tsx@@ -131,7 +131,7 @@ function ReservationCard({ r, tripId, onEdit, onDelete, files = [], onNavigateTo<div style={{ flex: 1, padding: '5px 10px', textAlign: 'center', borderRight: '1px solid var(--border-faint)' }}><div style={{ fontSize: 9, fontWeight: 600, color: 'var(--text-faint)', textTransform: 'uppercase', letterSpacing: '0.03em' }}>{t('reservations.time')}</div><div style={{ fontSize: 11, fontWeight: 600, color: 'var(--text-primary)', marginTop: 1 }}>- {fmtTime(r.reservation_time)}{r.reservation_end_time ? ` – ${r.reservation_end_time}` : ''}+ {fmtTime(r.reservation_time)}{r.reservation_end_time ? ` – ${r.reservation_end_time.includes('T') ? fmtTime(r.reservation_end_time) : fmtTime(r.reservation_time.split('T')[0] + 'T' + r.reservation_end_time)}` : ''}</div></div>)}diff --git a/client/src/components/shared/CustomTimePicker.tsx b/client/src/components/shared/CustomTimePicker.tsxindex 4509dc9f8..16ea322d9 100644--- a/client/src/components/shared/CustomTimePicker.tsx+++ b/client/src/components/shared/CustomTimePicker.tsx@@ -69,6 +69,7 @@ export default function CustomTimePicker({ value, onChange, placeholder = '00:00const handleInput = (e: React.ChangeEvent<HTMLInputElement>) => {const raw = e.target.valueonChange(raw)+ if (is12h) return // let handleBlur parse 12h formatsconst clean = raw.replace(/[^0-9:]/g, '')if (/^\d{2}:\d{2}$/.test(clean)) onChange(clean)else if (/^\d{4}$/.test(clean)) onChange(clean.slice(0, 2) + ':' + clean.slice(2))@@ -80,7 +81,23 @@ export default function CustomTimePicker({ value, onChange, placeholder = '00:00const handleBlur = () => {if (!value) return- const clean = value.replace(/[^0-9:]/g, '')+ const raw = value.trim()++ // Parse 12h input like "5:30 PM", "5:30pm", "530pm"+ if (is12h) {+ const match12 = raw.match(/^(\d{1,2}):?(\d{2})?\s*(am|pm)$/i)+ if (match12) {+ let h = parseInt(match12[1])+ const m = match12[2] ? parseInt(match12[2]) : 0+ const isPm = match12[3].toLowerCase() === 'pm'+ if (h === 12) h = isPm ? 12 : 0+ else if (isPm) h += 12+ onChange(String(Math.min(23, h)).padStart(2, '0') + ':' + String(Math.min(59, m)).padStart(2, '0'))+ return+ }+ }++ const clean = raw.replace(/[^0-9:]/g, '')if (/^\d{1,2}:\d{2}$/.test(clean)) {const [hh, mm] = clean.split(':')const h = Math.min(23, Math.max(0, parseInt(hh)))