Cambiado tipo de datos de Date a LocalDate para pruebas médicas.
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
package TO;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
@@ -22,7 +19,7 @@ public class MedicalTestTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private int id;
|
||||
private Date date;
|
||||
private LocalDate date;
|
||||
private LocalTime time;
|
||||
private String observations;
|
||||
private String highresimage;
|
||||
@@ -33,13 +30,13 @@ public class MedicalTestTO implements Serializable {
|
||||
|
||||
public MedicalTestTO() {
|
||||
super();
|
||||
this.date = new Date();
|
||||
this.date = LocalDate.now();
|
||||
this.time = LocalTime.now();
|
||||
this.patient = new PatientTO();
|
||||
this.specialistDoctor = new SpecialistDoctorTO();
|
||||
}
|
||||
|
||||
public MedicalTestTO(int id, Date date, LocalTime time, String observations, String highresimage, MedicalTestType type,
|
||||
public MedicalTestTO(int id, LocalDate date, LocalTime time, String observations, String highresimage, MedicalTestType type,
|
||||
PatientTO patiend, SpecialistDoctorTO specialistDoctor) {
|
||||
this.setId(id);
|
||||
this.setDate(date);
|
||||
@@ -59,11 +56,11 @@ public class MedicalTestTO implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Date getDate() {
|
||||
public LocalDate getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
public void setDate(Date date) {
|
||||
public void setDate(LocalDate date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
@@ -119,11 +116,4 @@ public class MedicalTestTO implements Serializable {
|
||||
public String toString() {
|
||||
return Integer.toString(this.getId());
|
||||
}
|
||||
|
||||
public String getOnlyDate() {
|
||||
DateFormat df = DateFormat.getDateInstance(DateFormat.DATE_FIELD, new Locale("es", "ES"));
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
|
||||
return sdf.format(this.getDate());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user