diff --git a/src/main/java/ch/zhaw/gartenverwaltung/io/JsonTaskDatabase.java b/src/main/java/ch/zhaw/gartenverwaltung/io/JsonTaskDatabase.java index e16a74d..37c7016 100644 --- a/src/main/java/ch/zhaw/gartenverwaltung/io/JsonTaskDatabase.java +++ b/src/main/java/ch/zhaw/gartenverwaltung/io/JsonTaskDatabase.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer; import java.io.File; import java.io.IOException; @@ -34,7 +35,10 @@ public class JsonTaskDatabase implements TaskDatabase{ static { DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd"); LocalDateDeserializer dateDeserializer = new LocalDateDeserializer(dateFormat); + LocalDateSerializer dateSerializer = new LocalDateSerializer(dateFormat); + timeModule.addDeserializer(LocalDate.class, dateDeserializer); + timeModule.addSerializer(LocalDate.class, dateSerializer); } /**