diff --git a/src/main/java/org/ntlab/acanthus_server/entities/Animation.java b/src/main/java/org/ntlab/acanthus_server/entities/Animation.java index 7284e52..30034be 100644 --- a/src/main/java/org/ntlab/acanthus_server/entities/Animation.java +++ b/src/main/java/org/ntlab/acanthus_server/entities/Animation.java @@ -4,8 +4,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; import org.ntlab.acanthus_server.models.Accounts; import org.ntlab.acanthus_server.models.Gallery; +import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Collection; import java.util.Date; @@ -20,7 +22,7 @@ private String description; private Boolean isPublic; @JsonProperty("createdDate") - private LocalDateTime createdDate; + private String createdDate; @JsonProperty("lastUpdate") private String lastUpdate; @JsonProperty("likes") @@ -42,9 +44,14 @@ private boolean isDummy; public Animation(Integer aid, String name, Account owner) { + + LocalDateTime date = LocalDateTime.now(); + DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss"); + // ↑  "yyyy/MM/dd HH:mm:ss"という形の日付を表示させるための前処理 + this.aid = aid; this.name = name; - this.createdDate = LocalDateTime.now(); + this.createdDate = date.format(dateTimeFormatter); this.isPublic = false; this.owner = owner; this.editors.add(new Editor(owner, true)); @@ -124,7 +131,7 @@ return invites; } - public LocalDateTime getCreatedDate(){return createdDate;} + public String getCreatedDate(){return createdDate;} //----------------------------------------------------------------- // remover @@ -189,7 +196,10 @@ this.owner = ownerAccount; this.editors.add(new Editor(owner, true)); this.pageMap.put(0, new Page()); - this.createdDate = LocalDateTime.now(); + + LocalDateTime date = LocalDateTime.now(); + DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss"); + this.createdDate = date.format(dateTimeFormatter); //this.lastAccess = LocalDateTime.of(2015, 12, 15, 0, 0);