For implementing a date object in KMP is the best ...
# multiplatform
a
For implementing a date object in KMP is the best solution so far to make a "expect class" with full implementation on each platform?
e
i think so, yeah
there’s a few libraries you can try
https://github.com/erikc5000/island-time looks pretty good but i haven’t used it yet
👍 1
s
Island time looks interesting. Will try it out!
I've used klock in the past: https://github.com/korlibs/klock
a
Island time is a good name for a datetime library, if there are every any bugs or you never finish it, you can say its FAD because "Island time"
r
@Andrew You probably won’t need full implementation (though do you?). You can just add few expect functions like parsing the date and formatting it as per the UI. These are merely few lines of code. You can also make your custom representation of date follow
Comparable
interface if you want to sort things. In my experience (so far) I haven’t had the need to import a full date library, just few expect functions are enough.
👍 1
a
Yes I will have to look at my use cases before making a decision. So far the 2 main ones are date only where I need time spans or day of the week (like Mon/Tues). The other is timestamp for checking things like "Is timestamp older than 1 hour ago"