I'm trying to compare two dates for exactly one month. I used the code below for the validation. Its working for this case:
from Date:1/5/2013
to Date:1/6/2013
but not working if we consider February month, e.g.:
fromDate:28/2/2013;
toDate:31/3/2013;
Can you let me know the solution?
I tried the code below (source), but it's not working.
var fromDate = new Date(document.getElementById("Billing_From").value);
var toDate = new Date(document.getElementById("Billing_To").value);
fromDate.setMonth( fromDate.getMonth() + 1 );
if((fromDate-toDate) !=0)
{
alert("Please limit the date range to 1 month.");
}