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:
@@ -171,11 +171,10 @@ import {
|
||||
'dddd'
|
||||
)}
|
||||
@
|
||||
<!-- , -->
|
||||
<!-- {ae_util.iso_datetime_formatter(event_presentation_obj.start_datetime, pres_mgmt_loc.current.datetime_format)} -->
|
||||
{ae_util.iso_datetime_formatter(
|
||||
event_presentation_obj.start_datetime,
|
||||
pres_mgmt_loc.current.time_format
|
||||
'time_short',
|
||||
pres_mgmt_loc.current.use_12h
|
||||
)}
|
||||
</span>
|
||||
|
||||
@@ -247,19 +246,7 @@ import {
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => {
|
||||
if (pres_mgmt_loc.current.time_hours == 12) {
|
||||
pres_mgmt_loc.current.time_hours = 24;
|
||||
pres_mgmt_loc.current.datetime_format =
|
||||
'datetime_long';
|
||||
pres_mgmt_loc.current.time_format =
|
||||
'time_short';
|
||||
} else {
|
||||
pres_mgmt_loc.current.time_hours = 12;
|
||||
pres_mgmt_loc.current.datetime_format =
|
||||
'datetime_12_long';
|
||||
pres_mgmt_loc.current.time_format =
|
||||
'time_12_short';
|
||||
}
|
||||
pres_mgmt_loc.current.use_12h = !pres_mgmt_loc.current.use_12h;
|
||||
}}>
|
||||
time
|
||||
</button>
|
||||
@@ -283,7 +270,8 @@ import {
|
||||
)}
|
||||
{ae_util.iso_datetime_formatter(
|
||||
event_presentation_obj.start_datetime,
|
||||
pres_mgmt_loc.current.time_format
|
||||
'time_short',
|
||||
pres_mgmt_loc.current.use_12h
|
||||
)}
|
||||
</Element_ae_obj_field_editor>
|
||||
-
|
||||
@@ -301,7 +289,8 @@ import {
|
||||
})}>
|
||||
{ae_util.iso_datetime_formatter(
|
||||
event_presentation_obj.end_datetime,
|
||||
pres_mgmt_loc.current.time_format
|
||||
'time_short',
|
||||
pres_mgmt_loc.current.use_12h
|
||||
)}
|
||||
</Element_ae_obj_field_editor>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user