Respect the 12h/24h setting in cron schedule descriptions too

The Date & Time setting drove formatDateTime() everywhere, but the
human-readable cron description ("At 08:30 AM every day") came from
cronstrue, a separate library with its own independent AM/PM default
that the setting never touched. Pass its use24HourTimeFormat option
from the same shared setting so "Schedule" columns match the rest of
the app.

Added utils/date.ts's is24HourFormat() getter for this, since
formatDateTime() itself doesn't apply here (cronstrue does its own
cron-to-English rendering, not just time formatting).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5 committed 2026-09-15 22:35:05 +02:00
1 parent f92f8de96e
commit bc0e54fea8
2 files changed
+7 -2

No files matched your search

+5
View File
@@ -12,6 +12,11 @@ export function setDateTimeSettings(settings: DateTimeSettings): void {
current = settings;
}
/** Current 12h/24h preference, for formatters outside this file (e.g. cronstrue's use24HourTimeFormat option). */
export function is24HourFormat(): boolean {
return current.timeFormat === "24h";
}
function pad(n: number): string {
return String(n).padStart(2, "0");
}