Skip to content

Add a 12-hour clock option for displayed times#2105

Open
frankrousseau wants to merge 1 commit into
cgwire:mainfrom
frankrousseau:fix-1929-12-hour-time
Open

Add a 12-hour clock option for displayed times#2105
frankrousseau wants to merge 1 commit into
cgwire:mainfrom
frankrousseau:fix-1929-12-hour-time

Conversation

@frankrousseau

Copy link
Copy Markdown
Contributor

Problems

  • Clock times (comment timestamps, news feed, entity chat) are always rendered in 24-hour format, forcing users from 12-hour regions to convert in their head (fixes Option for 12-hour time #1929)

Solutions

  • Add an opt-in "12-hour clock (AM/PM)" toggle to the profile page, next to the timezone and language settings
  • Persist the preference in the person record generic data JSONB field through the existing profile save path, so it follows the user across browsers with no Zou schema change
  • Centralize time-of-day rendering in a new formatTimeOfDay helper in src/lib/time.js (plus a formatTime wrapper in the useTime composable) and use it in Comment, NewsRow and EntityChatDays, with unit tests covering 24h/12h, midnight and noon

Add an opt-in user preference to render clock times with AM/PM
instead of the 24-hour format. The flag is stored in the person
record generic data field, so it follows the user across browsers
without any backend change, and is saved through the existing
profile save path. Comment timestamps, news feed times and entity
chat times honour it via the new formatTimeOfDay helper.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option for 12-hour time

1 participant