diff --git a/src/main/java/com/production/ehayvanbackendapi/DTO/request/CreateOrUpdateAppointmentDTO.java b/src/main/java/com/production/ehayvanbackendapi/DTO/request/CreateOrUpdateAppointmentDTO.java index b020a84..400eb18 100644 --- a/src/main/java/com/production/ehayvanbackendapi/DTO/request/CreateOrUpdateAppointmentDTO.java +++ b/src/main/java/com/production/ehayvanbackendapi/DTO/request/CreateOrUpdateAppointmentDTO.java @@ -1,8 +1,13 @@ package com.production.ehayvanbackendapi.DTO.request; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; + import java.util.Date; public class CreateOrUpdateAppointmentDTO { + @JsonFormat(pattern = "dd-MM-yyyy HH:mm") + @DateTimeFormat(pattern = "dd-MM-yyyy HH:mm") private Date appointmentDate; private Integer petID; private Integer vetID; diff --git a/src/main/java/com/production/ehayvanbackendapi/Entities/Appointment.java b/src/main/java/com/production/ehayvanbackendapi/Entities/Appointment.java index aa9d6a2..588af78 100644 --- a/src/main/java/com/production/ehayvanbackendapi/Entities/Appointment.java +++ b/src/main/java/com/production/ehayvanbackendapi/Entities/Appointment.java @@ -1,7 +1,9 @@ package com.production.ehayvanbackendapi.Entities; +import com.fasterxml.jackson.annotation.JsonFormat; import jakarta.persistence.*; import net.sf.jsqlparser.expression.DateTimeLiteralExpression; +import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; @@ -21,6 +23,8 @@ public class Appointment { @JoinColumn(name = "PetID", referencedColumnName = "PetID") private Pet PetID; @Column(nullable = false) + @DateTimeFormat(pattern = "dd-MM-yyyy HH:mm") + @JsonFormat(pattern = "dd-MM-yyyy HH:mm") private Date AppointmentDate; public int getAppointmentID() { return AppointmentID;