Skip to content

refactor(settings): replace SimpleDateFormat with kotlinx-datetime#5992

Merged
jamesarich merged 1 commit into
mainfrom
claude/relaxed-khayyam-41bab8
Jun 28, 2026
Merged

refactor(settings): replace SimpleDateFormat with kotlinx-datetime#5992
jamesarich merged 1 commit into
mainfrom
claude/relaxed-khayyam-41bab8

Conversation

@jamesarich

Copy link
Copy Markdown
Collaborator

🧹 Why

:feature:settings had the last two java.text.SimpleDateFormat usages in the app — Android-only JDK date formatting in a module that's otherwise KMP-friendly. This tidies them up to the kotlinx-datetime LocalDateTime.Format idiom already established in Debug.kt.

🛠️ What changed

  • SettingsScreen.kt — node-config export filename timestamp (yyyyMMdd).
  • PersistenceSection.kt — range-test / data-log export filename timestamp (yyyyMMdd_HHmmss); the format descriptor is hoisted to a top-level val (keeps the composable under detekt's LongMethod limit).
  • Dropped the now-unused java.text.SimpleDateFormat, java.util.Locale, and toDate/toInstant imports.

Notes for reviewers

  • Behaviour preserved: still device-local time (TimeZone.currentSystemDefault()) and the same date patterns, so exported filenames are unchanged. Debug.kt uses TimeZone.UTC; I deliberately did not match that here to avoid changing existing filename semantics — happy to switch if UTC is preferred.
  • No shared helper across the two files — the patterns differ, so a common util wasn't worth it.

Testing Performed

./gradlew spotlessCheck detekt :feature:settings:compileAndroidMain — all pass.

🤖 Generated with Claude Code

Swap the two java.text.SimpleDateFormat export-filename timestamps in
:feature:settings for the kotlinx-datetime LocalDateTime.Format idiom
already used in Debug.kt, dropping the java.text/java.util.Locale and
toDate/toInstant helper imports. Behaviour preserved: device-local
time, same yyyyMMdd / yyyyMMdd_HHmmss patterns.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions github-actions Bot added the refactor no functional changes label Jun 28, 2026
@jamesarich jamesarich enabled auto-merge June 28, 2026 14:35
@jamesarich jamesarich added this pull request to the merge queue Jun 28, 2026
Merged via the queue into main with commit 0b81257 Jun 28, 2026
22 checks passed
@jamesarich jamesarich deleted the claude/relaxed-khayyam-41bab8 branch June 28, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor no functional changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant