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 content of my alert
comes invalid date
.
Date in the format dd / mm / yyyy
All right?