Tickets: nur eine gelesene Uhrzeitspanne bleibt im Termin zusammen, Rohtext bricht weiter frei um

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-06 06:03:14 +00:00
1 parent ed8bdba015
commit f6b329b208
1 file changed
+7 -5
+7 -5
View File
@@ -63,14 +63,16 @@ export default function TicketPage() {
return <TicketView key={ticket.$id} ticket={ticket} updateWorkorder={updateWorkorder} tab={activeTab} /> return <TicketView key={ticket.$id} ticket={ticket} updateWorkorder={updateWorkorder} tab={activeTab} />
} }
// Datum und Uhrzeitspanne bleiben je in einer Zeile: umbrechen darf nur das Komma dazwischen. // Eine gelesene Uhrzeit oder Spanne ("09:30" bzw. "09:30–10:30") bricht nicht in sich um, nur davor am Komma.
// Rohtext ohne ", " (unlesbare Altwerte) bricht weiter frei um. // Unlesbare Altwerte (Rohtext) brechen weiter frei um.
const TIME_RANGE = /^\d{2}:\d{2}(–\d{2}:\d{2})?$/
function AppointmentText({ text }) { function AppointmentText({ text }) {
const at = text.indexOf(', ') const at = text.lastIndexOf(', ')
if (at === -1) return text if (at === -1 || !TIME_RANGE.test(text.slice(at + 2))) return text
return ( return (
<> <>
<span className="nowrap">{text.slice(0, at)}</span>, <span className="nowrap">{text.slice(at + 2)}</span> {text.slice(0, at)}, <span className="nowrap">{text.slice(at + 2)}</span>
</> </>
) )
} }