Commit 76e02658 authored by Eugene Shapovalov's avatar Eugene Shapovalov 💬

Resolve discussion comments.

parent 66c123a1
......@@ -12,11 +12,11 @@ import java.lang.reflect.Type
*/
class LocalDateDeserializer : JsonDeserializer<LocalDate> {
private val dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd")
override fun deserialize(
json: JsonElement,
type: Type,
jsonDeserializationContext: JsonDeserializationContext
): LocalDate {
return LocalDate.parse(json.asJsonPrimitive.asString, DateTimeFormatter.ofPattern("yyyy-MM-dd"))
}
): LocalDate = LocalDate.parse(json.asJsonPrimitive.asString, dateTimeFormatter)
}
\ No newline at end of file
......@@ -9,14 +9,11 @@ import java.lang.reflect.Type
class OffsetDateTimeDeserializer : JsonDeserializer<OffsetDateTime> {
private val dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSX")
override fun deserialize(
json: JsonElement,
typeOfT: Type,
context: JsonDeserializationContext?
): OffsetDateTime {
return OffsetDateTime.parse(
json.asJsonPrimitive.asString,
DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSX")
)
}
): OffsetDateTime = OffsetDateTime.parse(json.asJsonPrimitive.asString, dateTimeFormatter)
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment