Hey guys :wave: I’ve just published a kotlinx-date...
# multiplatform
r
Hey guys 👋 I’ve just published a kotlinx-datetime-ext library the fills the gap between
java.datetime
and
kotlinx.datetime
since java had much more functionalities you can find it here https://github.com/RaedGhazal/kotlinx-datetime-ext with full documentation on what it provides and how to use it initially I just wrote a blog post on how to write you own helper functions but then thought of making it even easier by creating the library, will appreciate your support by giving me feedback, opening issues or even contribute! (leaving a star can be also nice ❤️) Thanks!
👀 3
🎉 3
K 1
r
Nice work by why only android and ios targets?
r
Hey @Robert Jaros Just wrote a reply to this actually here We can probably easily support other JVM targets actually
🙏 1
p
is this extension necessary?
Copy code
val afterFiveDays = localDateTime.plus(5, DateTimeUnit.DAY)
I think kotlinx has this feature:
Copy code
val afterFiveDays = localDateTime + 5.days
👀 1
r
oh, does it?
p
documented under this paragraph I think
r
just checked,
val afterFiveDays = localDateTime + 5.days
this won’t work actually what
+ 5.days
will only work with instants, so you have to convert to instant, do the math, convert back to localdatetime
which what this extension function actually does
Copy code
val afterFiveDays = localDateTime.plus(5, DateTimeUnit.DAY)
p
ah, okay, that's annoying. Tnx for checking
r
it is, hope my library makes it less annoying 😅
but I actually can bring
val afterFiveDays = localDateTime + 5.days
to my library, I’m just checking something quick, hold on
p
that would be great yeah, shouldn't be that hard to add I guess
1
r
its supported now 🎉 check version
1.0.2
p
Great, thanks!
r
Hey @Robert Jaros what platforms did you want? desktop?
r
JS an WasmJs
I'm a web developer 🙂
r
ah, still surprised of the fact that someone is using KMP already mainly for web development 😄 was under the impression that its mostly Android devs trying to support more platforms but is this the target you mean? just created a new KMP project with web support using jetbrains wizard
r
Yes, but only one of them. JS (
jsMain
) should be supported as well (wasm is still experimental and js is stable)
1
r
alright the library supports JVM/Desktop now on 1.1.0 version @Michael Paus
🍺 2