feat(profile): custom date/time format builder with token preview #119
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
psa-systems/mokosh-apps!119
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/pms-254-custom-date-format-builder"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Lands the second slice of PMS-252: the Custom... button under the preset dropdown now opens a modal with the Date Builder shown in the design. Users can either type into the free-form Format string input or click any of the labelled token pills (Year YYYY/YY, Month MM/M/MMM/MMMM, Day DD/D/Do, Weekday ddd/dddd, Hour HH/H/hh/h, Minute mm/m, Second ss/s, AM/PM A/a/a.m., Separators -/./,/space/colon). Pill clicks append the token to the draft. A live preview at the top of the modal renders against now() so every edit is visible immediately; a yellow alert lights up whenever the format contains an alphabetic run the tokenizer cannot consume, e.g. a typo'd lowercase yyyy.
Cancel keeps the previously-saved format intact; Apply writes the draft back into the parent signal and is disabled while warnings are present so a broken format cannot leave the modal. Save changes on the Profile page still drives the same /me PUT round-trip the preset slice uses, so the persistence path is unchanged.
crate::utils::datetime::token_warningsships with 7 unit tests covering empty input, fully-valid formats, lowercase/uppercase typos, stray letters between tokens, runs that contain both valid and invalid bytes, and adjacent-token cases that must not false-warn.#PMS-254