comparing 2 dates with javascript -
i want compare 2 dates in following format shown below in variables a , b . want check if a greater b code below isnt working since not regular number
var = "4/29/2015"; var b = "4/10/2015"; if(a > b){ alert("working"); }
convert strings date objects.
var = new date("4/29/2015"); var b = new date("4/10/2015"); if (a > b) { console.log(a + " greater " + b); }
Comments
Post a Comment