Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: iOS app ignores the system 24-Hour Time setting and shows 12-hour times #45402

OpenMedalKing(GitHub profile, opens in a new tab) opened this issue 0 comments
MedalKing(GitHub profile, opens in a new tab)commented

Before submitting

  • I searched existing issues and did not find a duplicate. #33078 (merged) fixed this for Android message timestamps only, and #38670 (closed) lists the iOS case under "Not in this change" without an issue for it. Open PR #45397 edits the same message formatter files but does not change the hour cycle.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/mobile

Steps to reproduce

  1. On an iPhone, set Settings → General → Language & Region: Preferred Languages English (US) first, then Suomi; Region: Finland. iOS's own Region Format Example then shows times as 9.41.
  2. Turn on Settings → General → Date & Time → 24-Hour Time. The status bar shows 11.07.
  3. In the T3 Code iOS app, leave Settings → General → Language on English.
  4. Open a thread and look at the time under a message. Other screens that show a time of day use the same locale-only formatting: scheduled tasks, snooze times, the work log, usage-limit reset times, and the usage widget.

From the code, I expect the same with any 12-hour region (such as United States) plus 24-Hour Time on, but I only observed the Finland setup above.

Expected behavior

Times follow the iOS 24-Hour Time setting, for example 15:07, the same way the rest of iOS and the Android app (since #33078) do.

Actual behavior

The time under the message reads 11:05 AM, while the iOS status bar at the same moment reads 11.07. So the app uses neither the 24-Hour Time switch nor the region's own 24-hour default; it formats like US English.

Impact

Minor bug or occasional failure

Version or commit

iOS app 2.4.0 (303); source checked at main @ 0fbd32628b

Environment

iPhone 15 Pro Max, iOS 27.2.1; iPhone Language English (US), Preferred Languages English (US) then Finnish, Region Finland, 24-Hour Time on, time zone Europe/Helsinki; T3 app language English

Additional context

Cause in source (main @ 0fbd32628b)

  • Message timestamps: useMessageTimeFormatter.ts reads the system clock preference only on Android:
    function systemUses24HourClock() {
      if (Platform.OS !== "android") return undefined;
      return requireNativeModule<{ is24HourFormat(): boolean }>("T3NativeControls").is24HourFormat();
    }
    On iOS, is24Hour is undefined, so createMessageTimeFormatter sets no hourCycle and passes no locale, so Intl.DateTimeFormat falls back to Hermes's default locale and that locale's default hour cycle. The T3NativeControls module implements is24HourFormat only on Android (T3NativeControlsModule.kt) and has no iOS counterpart.
  • Open question: Hermes's Apple Intl takes the default locale from [NSLocale currentLocale] (PlatformIntlApple.mm getDefaultLocale), and English (Finland) defaults to 24-hour, so I'd have expected 11.05 even without the switch. Getting 11:05 AM suggests the JS default locale resolves to en-US (or loses the region) in this app. Even if the region came through, Hermes derives the hour cycle from a locale built from the identifier, which doesn't carry the user's 24-Hour Time override. That's why passing an explicit hourCycle from native is the robust fix.
  • Other mobile times: scheduledTaskPresentation.ts, SettingsScheduledTasksRouteScreen.tsx, customSnoozeDate.ts, thread-work-log.tsx, UsageLimitRecoveryCard.tsx, usageAxisLabels.ts, GuideNotice.tsx, NewTaskContextPickerScreens.tsx and the widgets (SubscriptionUsage.tsx, subscriptionUsageSnapshot.ts) call toLocaleTimeString / Intl.DateTimeFormat with the locale only, so they ignore the system preference on iOS (and on Android too, outside message timestamps).

Possible fix: add an iOS is24HourFormat to T3NativeControls, for example by checking whether DateFormatter.dateFormat(fromTemplate: "j", options: 0, locale: .current) contains a. Then drop the Android-only guard and share the resulting hour cycle with the other mobile time formatters.

Related: the synced Time format setting (timestampFormat: Locale / 12-hour / 24-hour) is only read by apps/web. Nothing in apps/mobile reads it, so choosing 24-hour on desktop doesn't help on the phone either. Respecting it on mobile, falling back to the system preference when it is "Locale", would also fix this.

Workaround: none known. Region Finland plus 24-Hour Time is already set here and the app still shows 12-hour times.

  1. tanstack-source added labelsbug

Sign in to join this conversation.