fix: use system time format in channel details - #1123
Open
guzino wants to merge 2 commits into
Open
Conversation
Greptile SummaryRoutes Lightning connection timestamps through the shared system-aware date formatter.
Confidence Score: 5/5The PR appears safe to merge with no concrete changed-code failure identified. The new parsing path preserves malformed timestamp fallback, valid timestamps retain their epoch value through conversion, and the shared formatter observes the device clock-format state while keeping the intended abbreviated date shape.
|
| Filename | Overview |
|---|---|
| app/src/main/java/to/bitkit/ext/DateTime.kt | Adds ISO-8601 epoch parsing and a localized abbreviated-month date-time style without altering existing styles. |
| app/src/main/java/to/bitkit/ui/settings/lightning/ChannelDetailScreen.kt | Replaces screen-local timestamp formatting with the shared system-clock-aware formatter while retaining malformed-string fallback behavior. |
| app/src/test/java/to/bitkit/ext/DateTimeExtTest.kt | Covers supported ISO timestamp forms, invalid inputs, clock formats, localization, and round-trip formatting. |
| changelog.d/next/1110.fixed.md | Accurately describes the corrected device time-format behavior. |
Reviews (1): Last reviewed commit: "fix: use system time format in channel d..." | Re-trigger Greptile
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 #1110
This PR routes the Lightning connection timestamps through the shared
uiDateTextentry point, so they follow the device's 12/24-hour setting.Description
ChannelDetailScreenbuilt its ownDateTimeFormatterfromDatePattern.CHANNEL_DETAILS, the hardcoded 24-hour patternMMM d, yyyy, HH:mm. A connection created at 8:58 PM therefore read20:58on a device set to a 12-hour clock, while the activity list one screen away read8:58 PM. #1111 addeduiDateTextand left this screen for a follow-up.The date shape is kept exactly as it was. iOS renders this screen from
MMM d, yyyy - HH:mminLightningConnectionDetailView.swift, so the abbreviated month is the design, and only the fixed clock is the defect. That hardcodedHH:mmis present on iOS too, which this PR does not address.formatDateandformatUnixTimestampwithuiDateText, so Created on, Order expiry, Opened on and Closed on all read the clock format fromLocalIs24HourFormat.UiDateStyle.DATE_TIME_YEAR_SHORTfor theMMM d, yyyydate this screen shares with iOS, leaving the four existing styles untouched.String.toEpochSecondsOrNull()inext/DateTime.ktfor the ISO-8601 strings Blocktank returns, keeping the previous behaviour of falling back to the raw string when it cannot be parsed.ULongit already is. It previously wentULong→Long→Instantto rebuild the same value.DatePattern.CHANNEL_DETAILSand the screen's five date imports, all unused now.Preview
QA Notes
Manual Tests
Jul 31, 2026, 7:28 PM, matching the status bar.Jul 31, 2026, 19:28. The date keeps theJul 31, 2026shape in both.regression:a connection whose order timestamp is malformed still renders the raw value instead of an empty row.Automated Checks
DateTimeExtTest.kt:toEpochSecondsOrNullover the plain and millisecond ISO-8601 forms, unparseable and empty input, the new style in both clock formats, and its month name underLocale.GERMANY.just compile,just test,just lintall pass, no new detekt findings.