From ed47e58a356e275bb526d7efe80b84570d2c8192 Mon Sep 17 00:00:00 2001 From: BenoƮt Verhaeghe Date: Sun, 5 Feb 2017 16:26:00 +0100 Subject: [PATCH] Better format Json DATE --- src/main/java/etunicorn/entity/Personne.java | 3 +++ src/main/java/etunicorn/entity/Session.java | 3 +++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/main/java/etunicorn/entity/Personne.java b/src/main/java/etunicorn/entity/Personne.java index 9093723..022e324 100644 --- a/src/main/java/etunicorn/entity/Personne.java +++ b/src/main/java/etunicorn/entity/Personne.java @@ -1,5 +1,7 @@ package etunicorn.entity; +import com.fasterxml.jackson.annotation.JsonFormat; + import javax.persistence.*; import java.util.Date; @@ -50,6 +52,7 @@ public class Personne { this.carte = carte; } + @JsonFormat(pattern="YYYY-MM-DD hh:mm:ss") public Date getNaissance() { return naissance; } diff --git a/src/main/java/etunicorn/entity/Session.java b/src/main/java/etunicorn/entity/Session.java index ed1b4f1..d24257b 100644 --- a/src/main/java/etunicorn/entity/Session.java +++ b/src/main/java/etunicorn/entity/Session.java @@ -1,5 +1,7 @@ package etunicorn.entity; +import com.fasterxml.jackson.annotation.JsonFormat; + import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.ManyToOne; @@ -58,6 +60,7 @@ public class Session { this.token = token; } + @JsonFormat(pattern="YYYY-MM-DD hh:mm:ss") public Date getValidity() { return validity; } -- libgit2 0.21.2