1
Good morning
$("#salvar").on('click', function(e){
var startDate = new Date($('#data_abertura').val());
var endDate = new Date($('#data_encerramento').val());
alert(startDate);
if (startDate > endDate){
$("#error").html("Data de Abertura deve ser menor ou igual a Data de Encerramento");
$('#myModal').modal("show");
e.preventDefault();
}
});
the contents of my alert
comes invalid date
.
Date in dd/mm/YYYY format
All right?
You can display the HTML of
data_abertura
anddata_encerramento
? you know its value?– Sergio