From e7352c31f076370a853f400811b5429e732140a7 Mon Sep 17 00:00:00 2001 From: velz2020 Date: Wed, 7 Feb 2018 19:58:22 +0530 Subject: [PATCH] BATCHCARD TIME VALIDATION ISSUE FIXED --- application/views/edit_hourly_batch_card.php | 24 +++++++------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/application/views/edit_hourly_batch_card.php b/application/views/edit_hourly_batch_card.php index e0260dc0..7cac6314 100755 --- a/application/views/edit_hourly_batch_card.php +++ b/application/views/edit_hourly_batch_card.php @@ -337,8 +337,7 @@ var stop = $('#auto_stop').val(); if(start != '' && stop != '') { - if(start.length != 5) -{ + if(start.length != 5){ alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25'); document.getElementById('auto_start').value=""; setTimeout(function(){ @@ -349,8 +348,7 @@ if(start != '' && stop != '') } -if(stop.length != 5) -{ +if(stop.length != 5){ alert('Please Enter Time in 24 Hrs Format.If time is 9:25,Feed like 09:25'); document.getElementById('auto_stop').value=""; setTimeout(function(){ @@ -359,11 +357,12 @@ if(stop.length != 5) return false; } + var atime = ''; 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 = ''; @@ -374,7 +373,7 @@ if(stop.length != 5) } - if(isNaN(stop[0]) || isNaN(stop[1])) + 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 = ''; @@ -385,20 +384,13 @@ if(stop.length != 5) } + + if((start[0] > stop[0])) { alert('Enter Valid Time'); document.getElementById('auto_stop').value = ''; - setTimeout(function(){ - $('#auto_stop').focus();},0 - ); - return false; - } - - if((start[1] > stop[1])) - { - alert('Enter Valid Time'); - document.getElementById('auto_stop').value = ''; + setTimeout(function(){ $('#auto_stop').focus();},0 );