StreetComplete icon indicating copy to clipboard operation
StreetComplete copied to clipboard

Migrate from java.time to kotlinx-datetime

Open westnordost opened this issue 2 years ago • 2 comments

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.

westnordost avatar Jul 26 '22 19:07 westnordost

hey @westnordost, I want to pick this up. if it is still in the Unassigned stage.

sumanabhi avatar Jul 30 '22 06:07 sumanabhi

It is not assigned. Thank you! Or well, @matkoniecz assigned it to you now :-)

westnordost avatar Jul 30 '22 11:07 westnordost

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.

westnordost avatar Oct 02 '22 22:10 westnordost