https://kotlinlang.org logo
Title
i

iex

02/06/2020, 6:25 AM
any library recommendation for lightweight date operations (like "days between 2 dates")? I'd prefer something that doesn't add extensions to numbers
:google: 1
:stackoverflow: 1
k

Kort

02/06/2020, 6:44 AM
Joda Time?
i

iex

02/06/2020, 7:47 AM
okay I was looking for something lightweight and preferably written in Kotlin?
nothing against Joda Time, it just feels a bit overkill for this (and it's written in Java)
f

Faraz

02/06/2020, 9:39 AM
https://github.com/JakeWharton/ThreeTenABP ? not kotlin, but lightweight , but please check if it suits your needs
4
👍 2
c

Casey Brooks

02/06/2020, 2:49 PM
Yes, the java.time APIs are absolutely wonderful for working with dates, and I’d encourage you to use them (or the ABP library port of it) as they are the intended standard API for dates on the JVM. They were developed with help from the Joda Time team, and Joda Time should now be considered deprecated (as noted on their website https://www.joda.org/joda-time/). A Kotlin MP alternative is Island Time, which looks pretty nice, though I haven’t actually used it for myself yet. It looks very similar to the java.time APIs, though it does add extensions to numbers (which I’m not a fan of, either). https://github.com/erikc5000/island-time
i

iex

02/06/2020, 8:50 PM
@Faraz @Casey Brooks the new java api looks good, thanks! 👍
b

Barco

02/09/2020, 10:29 PM
i

iex

02/10/2020, 6:26 AM
@Barco thanks! Saw that too. But it adds extensions to numbers.