Dear All,
I have 2 date object. I try to compare them but I dont get any results there. How can I do that ? My snippet of code is as below
var dateFrom=document.getElementById("myCalendar1").value;
dateFromArray=dateFrom.split("/");
var myDateFrom=new Date(dateFromArray[2],dateFromArray[1],dateFromArray[0]);
var dateTo=document.getElementById("myCalendar2").value;
dateToArray=dateTo.split("/");
var myDateTo=new Date(dateToArray[2],dateToArray[1],dateToArray[0]);
if(myDateFrom>myDateTo)
{
alert("Date To Must Be Less Than Date From"+myDateFrom);
}
I have 2 date object. I try to compare them but I dont get any results there. How can I do that ? My snippet of code is as below
var dateFrom=document.getElementById("myCalendar1").value;
dateFromArray=dateFrom.split("/");
var myDateFrom=new Date(dateFromArray[2],dateFromArray[1],dateFromArray[0]);
var dateTo=document.getElementById("myCalendar2").value;
dateToArray=dateTo.split("/");
var myDateTo=new Date(dateToArray[2],dateToArray[1],dateToArray[0]);
if(myDateFrom>myDateTo)
{
alert("Date To Must Be Less Than Date From"+myDateFrom);
}