I'm trying to sum up a date with 30 more days, below 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 this way too:
function validarContinuacaoCiclo(){
var dataEmissaoGuia = $("#hiddenDataEmissaoGuia").val();
var dataPrevistaAdministracao = $("#dataPrevistaAdministracaoTratamento").val();
var dataEmissãoValidada = new Date();
dataEmissãoValidada.setDate(dataEmissaoGuia.getDate() + 30);
}
I'm taking an invalid date type error. I believe the error is when adding the days with my date attribute that is coming as String . Can someone tell me a way to convert this String to a date of the American format? Or is there any other way to add days to a date?