2
I’m trying to sum up a date with another 30 days, down with the way I’m trying to do:
function validarContinuacaoCiclo(){
var dataEmissaoGuia = $("#hiddenDataEmissaoGuia").val();
var dataPrevistaAdministracao = $("#dataPrevistaAdministracaoTratamento").val();
var dataEmissãoValidada = new Date(dataEmissaoGuia.getDate + 30);
}
I tried to do it that way:
function validarContinuacaoCiclo(){
var dataEmissaoGuia = $("#hiddenDataEmissaoGuia").val();
var dataPrevistaAdministracao = $("#dataPrevistaAdministracaoTratamento").val();
var dataEmissãoValidada = new Date();
dataEmissãoValidada.setDate(dataEmissaoGuia.getDate() + 30);
}
Esou making an invalid date type error. I believe the error is to add the days with my date attribute that is coming as String. Can anyone tell me a way to convert this String into a date of American format? Or is there some different way to add days to a date?