Compare two dates with JavaScript
The Date object will do what you want – construct one for each date, then compare them using the >, <, <= or >=. The ==, !=, ===, and !== operators require you to use date.getTime() as in var d1 = new Date(); var d2 = new Date(d1); var same = d1.getTime() === d2.getTime(); var … Read more