feat(settings): add 12/24-hour time format toggle (#6) #42

Merged
makiolaj merged 2 commits from feat/time-format-toggle into release/v2.11.0 2026-06-27 13:18:05 +00:00
Owner

Implements Codeberg issue #6 — 12/24-hour time format toggle.

New TimeFormatPref (Auto/12h/24h). Auto follows the device 24-hour system setting. The resolved convention is provided app-wide via LocalUse24HourFormat, and a shared formatTimeOfDay helper is now the single source for every time-of-day label. Also fixes a pre-existing inconsistency where the agenda screen/widget hard-coded 24h while detail/edit/search/reminders followed the locale.

On-device verification checklist

  • Settings → Appearance → Time format: Automatic / 12-hour / 24-hour
  • 12-hour: week & day timeline gutter shows e.g. "1 PM" (check 48dp gutter isn't clipped)
  • 12-hour applies to: agenda screen, agenda widget, event detail, editor, search, reminder notification
  • 24-hour forces "14:00" everywhere even in a 12h locale
  • Automatic matches the device clock setting (toggle Android's 24-hour system setting and reopen)
  • Midnight/end-of-day label reads sensibly in both modes

Closes #6 (Codeberg).

Implements Codeberg issue #6 — 12/24-hour time format toggle. New `TimeFormatPref` (Auto/12h/24h). Auto follows the device 24-hour system setting. The resolved convention is provided app-wide via `LocalUse24HourFormat`, and a shared `formatTimeOfDay` helper is now the single source for every time-of-day label. Also fixes a pre-existing inconsistency where the agenda screen/widget hard-coded 24h while detail/edit/search/reminders followed the locale. **On-device verification checklist** - [x] Settings → Appearance → **Time format**: Automatic / 12-hour / 24-hour - [x] **12-hour**: week & day timeline gutter shows e.g. "1 PM" (check 48dp gutter isn't clipped) - [x] 12-hour applies to: agenda screen, agenda widget, event detail, editor, search, reminder notification - [x] **24-hour** forces "14:00" everywhere even in a 12h locale - [x] **Automatic** matches the device clock setting (toggle Android's 24-hour system setting and reopen) - [x] Midnight/end-of-day label reads sensibly in both modes Closes #6 (Codeberg).
makiolaj added 1 commit 2026-06-27 12:36:04 +00:00
feat(settings): add 12/24-hour time format toggle
All checks were successful
Translations / check (pull_request) Successful in 5s
CI / ci (pull_request) Successful in 11m16s
c91608e48a
Add a TimeFormatPref (Auto/12h/24h) preference. Auto follows the device's
24-hour system setting; the others force a clock app-wide. The resolved
convention is provided once at the app root via LocalUse24HourFormat, so
every in-app time label reads it without per-screen plumbing.

A shared, pure TimeFormat helper (formatTimeOfDay / formatMinuteOfDay /
formatHourLabel / timeOfDayFormatter) is now the single source for all
time-of-day rendering. Routing every site through it also fixes a
pre-existing inconsistency: the week/day timeline gutters and the agenda
screen + widget hard-coded 24h, while event detail/edit/search/reminders
followed the locale — so a 12h-locale user previously saw mixed formats.

Covered: week & day timelines (gutter + event blocks), agenda screen and
widget, event detail/edit, search, and reminder notifications.

Closes #6 (Codeberg)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
makiolaj added 1 commit 2026-06-27 12:53:48 +00:00
Merge remote-tracking branch 'origin/release/v2.11.0' into feat/time-format-toggle
All checks were successful
Translations / check (pull_request) Successful in 7s
CI / ci (pull_request) Successful in 9m45s
93cc264fbf
# Conflicts:
#	app/src/main/java/de/jeanlucmakiola/calendula/data/prefs/SettingsPrefs.kt
#	app/src/main/java/de/jeanlucmakiola/calendula/ui/settings/SettingsUiState.kt
#	app/src/main/res/values-de/strings.xml
#	app/src/main/res/values/strings.xml
makiolaj merged commit 53c0482760 into release/v2.11.0 2026-06-27 13:18:05 +00:00
makiolaj deleted branch feat/time-format-toggle 2026-06-27 13:18:05 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: makiolaj/calendula#42