feat(pres_mgmt): replace time_hours/time_format/datetime_format with single use_12h toggle

Three redundant store fields encoding the same AM/PM choice replaced with a single
`use_12h: boolean` in PresMgmtLocState. iso_datetime_formatter gains a third param
(use_12h: boolean | null = null) that auto-resolves 24h↔12h format name variants via
a symmetric FORMAT_PAIRS lookup — null default leaves all ~100 existing call sites intact.

Toggle surfaces in three places: Clock icon in session time chip (hidden button, same
visual), event Options modal Display section, and session Options modal Display section.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-05-15 14:29:57 -04:00
parent 1296b1077e
commit 631a77158c
6 changed files with 104 additions and 33 deletions

View File

@@ -84,9 +84,7 @@ export interface PresMgmtLocState {
lock_config: boolean;
// --- Query / search preferences ---
datetime_format: string;
time_format: string;
time_hours: 12 | 24;
use_12h: boolean;
qry_enabled: 'all' | 'not_enabled' | 'enabled';
qry_hidden: 'all' | 'hidden' | 'not_hidden';
qry_limit__files: number;
@@ -265,9 +263,7 @@ export const pres_mgmt_loc_defaults: PresMgmtLocState = {
lock_config: false,
// Query / search
datetime_format: 'datetime_12_long',
time_format: 'time_12_short',
time_hours: 12,
use_12h: true,
qry_enabled: 'enabled',
qry_hidden: 'not_hidden',
qry_limit__files: 75,