feat: add configurable 12-hour and 24-hour time formats#812
Open
anonymoususer72041 wants to merge 7 commits into
Open
feat: add configurable 12-hour and 24-hour time formats#812anonymoususer72041 wants to merge 7 commits into
anonymoususer72041 wants to merge 7 commits into
Conversation
RussH
requested changes
Jun 24, 2026
RussH
left a comment
Member
There was a problem hiding this comment.
PR #812 — Configurable 12-hour / 24-hour time formats
In activity.js, can you re-check the append logic around the date/hour/minutte/eetc fields? It looked like some of the old append code and new conditional append code may both still be present?
Contributor
Author
|
I re-checked the In the current branch state, I only see the date, hour and minute controls being appended once. The AM/PM select is created and appended only conditionally for 12-hour mode and the submit path also avoids reading the AM/PM field when it does not exist in 24-hour mode. I do not see a remaining duplicate append path in the current diff. Could you point me to the specific lines you had in mind if you are still seeing one? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a configurable site-wide time format setting that allows OpenCATS installations to use either 12-hour or 24-hour time display.
This wires the existing
site.time_format_24setting into site localization, session handling, localization settings, the first-run wizard and the installer. It also applies the configured time format across activity display and editing, calendar forms and settings, email template date/time replacement and other user-facing date/time output where appropriate.The default behavior remains unchanged: existing installations continue to use the 12-hour format unless the 24-hour format is explicitly selected.
Motivation
This improves OpenCATS internationalization by allowing installations to use the time format that matches their locale and users' expectations.
A large share of countries commonly use the 24-hour time format. Supporting both 12-hour and 24-hour formats makes OpenCATS more suitable for international deployments while preserving the existing default behavior for users who prefer the 12-hour format.