TIME VALIDATION ISSUEFIXED

This commit is contained in:
velz2020 2018-02-07 19:53:30 +05:30
parent 4ee430c9ba
commit b5db2ed3b9

View File

@ -390,7 +390,7 @@ if(stop.length != 5){
start = start.split(":");
stop = stop.split(":");
if(isNaN(start[0]) || isNaN(start[1]) )
if(isNaN(start[0]) || isNaN(start[1]) || parseFloat(start[0]) > 24 || parseFloat(start[1]) > 60)
{
alert("please Enter Valid Time");
document.getElementById('auto_start').value = '';
@ -401,7 +401,7 @@ if(stop.length != 5){
}
if(isNaN(stop[0]))
if(isNaN(stop[0]) || isNaN(stop[1]) || parseFloat(stop[0]) > 24 || parseFloat(stop[1]) > 60)
{
alert("please Enter Valid Time");
document.getElementById('auto_stop').value = '';
@ -412,16 +412,7 @@ if(stop.length != 5){
}
if(isNaN(start[0]))
{
alert("please Enter Valid Time");
document.getElementById('auto_start').value = '';
setTimeout(function(){
$('#auto_start').focus();},0
);
return false;
}
if((start[0] > stop[0]))
{
@ -433,16 +424,6 @@ if(stop.length != 5){
);
return false;
}
if((start[1] > stop[1]))
{
alert('Enter Valid Time');
document.getElementById('auto_stop').value = '';
setTimeout(function(){
$('#auto_stop').focus();},0
);
return false;
}
var h = parseFloat(stop[0]) - parseFloat(start[0]);
var m = parseFloat(stop[1]) - parseFloat(start[1]);