How are you supposed to do a date in Kotlin JS? I ...
# javascript
d
How are you supposed to do a date in Kotlin JS? I found a great way to do it in regular Kotlin but I don't appear to have access to that and every method in the kotlin.js seems to be depricated.
e
https://github.com/Kotlin/kotlinx-datetime is cross-platform • kotlin.js.Date is not deprecated, where are you seeing that? • JS Date is pretty poor, JS is in the process of building a replacement datetime api https://tc39.es/proposal-temporal/docs/index.html
d
kotlin.js.Date is not deprecated, where are you seeing that?
t
Non-deprecated accessors - inside
Duration.Companion
d
In either case, I'll try the Kotlinx, looks like it'll work so far
l
I also find that klock works pretty well and has formatting/parsing possibilities: https://github.com/korlibs/klock