3
I created this Edit Fields button, to change the data of these users I created, the name, name and document are working, without the date of birth is updated, but when I try to edit the Date of Birth, comes a bad request, because the form expects a LocalDateTime
, how do I turn this string into LocalDateTime
?
EDIT:
The Get of the Date of Birth.
EDIT 2: This could be so I’m just manipulating on the front
editarAdicional(item: any) {
this.edicaoAdicionais.idPessoa = item.idPessoa;
this.edicaoAdicionais.nomeCompleto = item.nomeCompleto;
this.edicaoAdicionais.nomeEmbossado = item.nomeEmbossado;
this.edicaoAdicionais.dataNascimento = this.formataDatas(item.dataNascimento);
this.edicaoAdicionais.documento = item.documento;
this.editandoAdicionais = true;
}
atualizarAdicional(item: any) {
let formatador = new Formatadores();
item.idPessoa = this.edicaoAdicionais.idPessoa;
item.nomeCompleto = this.edicaoAdicionais.nomeCompleto;
item.nomeEmbossado = this.edicaoAdicionais.nomeEmbossado;
let dataNascimento = formatador.parseDate(this.edicaoAdicionais.dataNascimento);
item.dataNascimento = dataNascimento.toISOString();
item.documento = this.edicaoAdicionais.documento;
this.editandoAdicionais = false;
"25/07/1981" is what you send to Java backend and there he tries to turn into
LocalDateTime
? And the get that returns "1981-07-25T00:00:00" is what it returns when there already is a date there?– hkotsubo
"25/07/1981" is the formatted date of get, I need to send it as String and transform as Localdatetime, I may have made a mistake about it, because I don’t quite understand how to manipulate dates.
– Ian Luca