When I create two identical JavaScript Date objects and then compare them, it appears that they are not equal. How to I test if two JavaScript dates have the same value?
var date1 = new Date('Mon Mar 11 2013 00:00:00');
var date2 = new Date('Mon Mar 11 2013 00:00:00');
console.log(date1 == date2); //false?
+a == +bor!(a - b), but that may be a bit obfuscated. Don't leave parsing random date strings to the Date constructor, either provide a standards compliant string (which isn't consistently supported yet) or provide values per ECMA-262.