I don't know why, when you enter a date, it give me back the same date but with one day less.
service.ts
protected convertDateFromClient(project: IProject): IProject {
const copy: IProject = Object.assign({}, project, {
entryDate: project.entryDate != null ? moment(project.entryDate, 'DD/MM/YYYY').format('YYYY-MM-DD') : null
});
return copy;
}
Project.java
...
@Column(name = "entry_date")
private LocalDate entryDate;
public LocalDate getEntryDate() {
return entryDate;
}
public Project entryDate(LocalDate entryDate) {
this.entryDate = entryDate;
return this;
}
public void setEntryDate(LocalDate entryDate) {
this.entryDate = entryDate;
}
The date entered: 12/2/2020 and return: 11/2/2020
Update: If I put the date 12/02/2020 (dd/MM/yyyy) by keyboard in the datePicker´s input, i recived from POST this 01/12/2020 (MM/dd/yyyy)
Any suggestions???