You cannot compare with == as they are actually 2 different objects. We could do it with (date1 - date2) === 0. It seems faster in Firefox, so let's change it

http://jsperf.com/dates-compare