time validation in grid comparision between two cell values

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),time is 24hrs format(05:00)

[code]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;
}
}
}[/code]

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.

[]please help me in doing this time validation.[/]