Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate. fix(mobile): honor Android clock format in message timestamps #33078 (merged) fixed this for Android message timestamps only, and fix(mobile): message dates follow T3's language #38670 (closed) lists the iOS case under "Not in this change" without an issue for it. Open PR fix(mobile): message timestamps follow T3's language instead of the phone's #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
- 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. - Turn on Settings → General → Date & Time → 24-Hour Time. The status bar shows
11.07. - In the T3 Code iOS app, leave Settings → General → Language on English.
- 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 @ 0fbd326
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 @ 0fbd326)
- Message timestamps:
useMessageTimeFormatter.tsreads the system clock preference only on Android:On iOS,function systemUses24HourClock() { if (Platform.OS !== "android") return undefined; return requireNativeModule<{ is24HourFormat(): boolean }>("T3NativeControls").is24HourFormat(); }
is24Hourisundefined, socreateMessageTimeFormattersets nohourCycleand passes no locale, soIntl.DateTimeFormatfalls back to Hermes's default locale and that locale's default hour cycle. TheT3NativeControlsmodule implementsis24HourFormatonly on Android (T3NativeControlsModule.kt) and has no iOS counterpart. - Open question: Hermes's Apple Intl takes the default locale from
[NSLocale currentLocale](PlatformIntlApple.mmgetDefaultLocale), and English (Finland) defaults to 24-hour, so I'd have expected11.05even without the switch. Getting11:05 AMsuggests the JS default locale resolves toen-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 explicithourCyclefrom 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.tsxand the widgets (SubscriptionUsage.tsx,subscriptionUsageSnapshot.ts) calltoLocaleTimeString/Intl.DateTimeFormatwith 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.
Activity