fix(android): time formatting uses AM/PM in French locale - #87
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes incorrect AM/PM time rendering for French users on Android by avoiding Date.formatted(date:time:) in the affected UI and using an explicit DateFormatter with Locale.current under #if os(Android). It also documents Android-specific build/locale pitfalls in the Skip architecture steering notes.
Changes:
- Replaced
Date.formatted(date: .omitted, time: .shortened)usage inSongLabelViewwith a newshortTimeString(from:)helper that setsDateFormatter.locale = Locale.currenton Android. - Kept the iOS/macOS path unchanged by continuing to use
Date.formatted(date:time:)on non-Android platforms. - Added an “Android Build Pitfalls” section to
SKIP_ARCHITECTURE.md, including notes about locale propagation and imports.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Sources/Maxi80/Views/RadioPlayer/SongLabelView.swift | Adds an Android-specific time formatting workaround and routes UI strings through it. |
| .kiro/steering/SKIP_ARCHITECTURE.md | Documents Android Fuse-module pitfalls and the Date.formatted locale issue/workaround. |
Suppressed comments (1)
Sources/Maxi80/Views/RadioPlayer/SongLabelView.swift:105
- The doc comment says the Android workaround derives locale from the app bundle’s preferred localization, but the implementation uses
Locale.current(andpreferredLocalizationsis documented as unavailable on Android in SKIP_ARCHITECTURE.md). This mismatch is confusing—please align the comment with the actual behavior.
/// On iOS, `Date.formatted(date:time:)` correctly picks up the device locale. On Android (native
/// fuse mode), SkipFoundation's implementation doesn't propagate the locale to the underlying
/// `java.text.DateFormat`, causing French users to see AM/PM. Work around this by using an explicit
/// `DateFormatter` with the locale derived from the app bundle's preferred localization.
/// See: https://github.com/skiptools/skip-foundation/issues/128
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
sebsto
force-pushed
the
fix/86-android-time-locale
branch
from
August 14, 2026 09:37
c3f29e8 to
3762401
Compare
Date.formatted(date:time:) on Android doesn't propagate the app locale to java.text.DateFormat, causing French users to see AM/PM. Work around this with an explicit DateFormatter + Locale.current inside #if os(Android). Also documents Android build pitfalls in SKIP_ARCHITECTURE steering.
sebsto
force-pushed
the
fix/86-android-time-locale
branch
from
August 14, 2026 10:13
3762401 to
0e86f0f
Compare
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.
Fixes #86
Problem
Date.formatted(date: .omitted, time: .shortened)on Android doesn't propagate the app locale tojava.text.DateFormat, so French users see AM/PM instead of 24h format in the "Diffusé à" line.Fix
Replace with an explicit
DateFormatterthat setsLocale.current, guarded behind#if os(Android). iOS path unchanged.Upstream
Opened skiptools/skip-foundation#128 — once fixed there, this workaround can be removed.
Also
Documents Android build pitfalls in
SKIP_ARCHITECTURE.mdsteering (don'timport Foundationalongside SwiftUI,preferredLocalizationsunavailable on Android).