fix(filelisting): replace SimpleDateFormat with DateTimeFormatter and Instant#338
fix(filelisting): replace SimpleDateFormat with DateTimeFormatter and Instant#338Avanish Jha (Kingjha13) wants to merge 3 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughFile listing sample is updated to use Kotlin 2.3.21 and modernizes date/time handling. The change replaces ChangesFile Listing Modernization
🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
This PR modernizes date handling in the filelisting sample and fixes several issues.
Changes
SimpleDateFormatwithDateTimeFormatterjava.util.Datewithjava.time.InstantYYYYtoyyyyrequest.location()which is no longer available in Ktor 3.x+in the HTML DSLWhy
SimpleDateFormatis not thread-safe and can produce incorrect results when shared across concurrent requests.DateTimeFormatteris immutable and thread-safe.YYYYuses week-based years and can display incorrect years around New Year boundaries.Instantis the modern Java time API and integrates cleanly withDateTimeFormatter.request.location()causes compilation issues in Ktor 3.x.Verification
./gradlew build./gradlew run