var onemonth = 3;
var oneyear = 2005;
var twomonth = 10;
var twoyear = 2000;
How can i split this and compare?
In this example is:
var firstdate = onemonth + oneyear;
var seconddate = twomonth + twoyear;
if(firstdate < seconddate){
alert('error');
}
How is the best method for compare two date if i have only month and year?
What about using the native Date object like this?
With your variables it will yield “ok”.