StreetComplete
StreetComplete copied to clipboard
Migrate from java.time to kotlinx-datetime
A further step to make the core part of StreetComplete platform independent (#1892), usages of java.time
classes should be replaced with kotlinx-datetime.
I have had a cursory look at v0.4.0 so far and it looks stable enough now, though some convenience functions are missing.
Steps to do
- add kotlinx-datetime as dependency
- Ctrl+F for usages of
java.time
in the project - replace usages with equivalent classes from kotlinx-datetime
- (you'll notice, a lot of convenience functions are missing, so add those as extension functions to
util/ktx/*.kt
instead of littering the code with unwieldy constructs)
Note There is no 100% guarantee that every use case java.time is used in StreetComplete can be covered with kotlinx-datetime 0.4.0, after all it is still marked as "experimental" and I have had only a cursory look. But it looks quite complete by now.
hey @westnordost, I want to pick this up. if it is still in the Unassigned stage.
It is not assigned. Thank you! Or well, @matkoniecz assigned it to you now :-)
I'll just unassign you in case someone else would like to do this. It can be re-assigned when you or someone else actually starts to work on it.