Skip to content

Commit

Permalink
fix: msg alert when worng date blur
Browse files Browse the repository at this point in the history
  • Loading branch information
elfiservice committed Mar 2, 2018
1 parent 3aa7e38 commit 9db50c7
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions modulos/tecnico/orcamento/aprovados/editar_orc_aprovado.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function VerificaData(digData, idData) {
var ano = data.substr(6, 4);
if (tam === 10) {

if ((ano > 1900) || (ano < 2100)) {
if ((ano > 1900) && (ano < 2100)) {
switch (mes) {
case '01':
case '03':
Expand Down Expand Up @@ -248,23 +248,15 @@ function VerificaData(digData, idData) {
}
}

if (ano === 0000 && mes === 00 && dia === 00) {

return true;
} else
{


if (document.getElementById(idData).id === 'data_inicio') {
document.getElementById("data_inicio").value = "00/00/0000";
alert("A Data " + data + " e invalida!");
return false;
} else if (document.getElementById(idData).id === 'data_conclusao') {
document.getElementById("data_conclusao").value = "00/00/0000";
alert("A Data " + data + " e invalida!");
return false;
}
if (ano === '0000' && mes === '00' && dia === '00') {

return true;
} else {
alert("A Data " + data + " e invalida!");
let inputData = document.getElementById(idData);
inputData.value = "00/00/0000";
inputData.focus();
}
}</script>

Expand Down

0 comments on commit 9db50c7

Please sign in to comment.