Skip to content

Commit

Permalink
Added so that we can handle ZoneDateTime in a good way as json
Browse files Browse the repository at this point in the history
  • Loading branch information
jansoren committed May 9, 2024
1 parent 04653ab commit 0876c0c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/io/github/filelize/Filelizer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.github.filelize;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -24,7 +25,7 @@ public class Filelizer implements IFilelizer {
public Filelizer(String basePath) {
var objectMapper = new ObjectMapper();
objectMapper.registerModule(new JavaTimeModule());
objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z"));
objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
this.filelizerObject = new FilelizerObject(basePath, objectMapper);
this.filelizerSingle = new FilelizerSingle(basePath, objectMapper);
this.filelizerMultiple = new FilelizerMultiple(basePath, objectMapper);
Expand All @@ -33,7 +34,7 @@ public Filelizer(String basePath) {

public Filelizer(String basePath, ObjectMapper objectMapper, FilelizeType defaultFilelizeType) {
objectMapper.registerModule(new JavaTimeModule());
objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z"));
objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
this.filelizerObject = new FilelizerObject(basePath, objectMapper);
this.filelizerSingle = new FilelizerSingle(basePath, objectMapper);
this.filelizerMultiple = new FilelizerMultiple(basePath, objectMapper);
Expand Down

0 comments on commit 0876c0c

Please sign in to comment.