validating time

Im validating time where time should accept only numbers and (:slight_smile: and totime should not be less than fromtime.(totime should be greater than from time)
myDataProcessor.setVerificator(1,validate_grid);
myDataProcessor.setVerificator(2,validate_grid);
//validation code:

var err_str="";
function validate_grid(value,id,ind)
{
if(ind==1 || ind==2)
{
var patt=/^([0][0-9]|[0-9]|[1][0-9]|[2][0-3])[:]{1}[0-5][0-9]$/;//accepts only numbers & (:slight_smile:
if(!patt.test(value))
{
mygrid.setCellTextStyle(id,ind,“background-color:yellow;”);
if(err_str!="")
err_str+="\n"+(ind+1)+".Enter numbers and (:slight_smile: only…[ex.05:00 24hr format]";
else
err_str=(ind+1)+".Enter numbers and (:slight_smile: only…[ex.05:00 24hr format]";
return false;
}
else
{
mygrid.setCellTextStyle(id,ind,“background-color:white;”);
return true;
}
}
}
here ind==1 is fromtime and ind==2 is totime .i need to validate time where fromtime should be less than totime and totime should be greater than fromtime.

Here time format is 24 hrs eg:05:00.

Regards
narinas.

The current state of your validation rule works well.
If you have any issues with your code - please, clarify what’s the stuck.