Philipp Karlsson

07/20/2020, 12:02 PM
Hi there. I have a question about using Klock in multiplatform kotlin projects. I have a backend, multiplatform and frontend module with gradle. The backend and fronted use the model from the multiplatform with the kotlinx-serialization-runtime. The backend works as expected but the fronted always came up with error messages like a missing compareTo-function. With Serialization I get Serializer has not been found for type 'DateTimeTz' Example: (Multiplatform)
data class(dates: List<DateTimeTz>)
(Frontend after receiving the objects)
--> Objects look like:
Object { adjusted: 1577667600000, offset: 3600000 }
Error during:
I just included the implementations for multiplatform, jvm and js. The communication between backend and frontend is via REST. If I remove the serialization, I get error messages like missing compareTo functions.

Deactivated User

07/20/2020, 10:28 PM
Maybe you have to provide a custom serializer or somwthing. Not worked with klock + kotlinx.serialization yet