Beware of date camparison in javascript!
You can’t compare dt1 == dt2 cause this’ll check if it the same obj, not check value.
Only way is to dt1.getTime()==dt2.getTime()
For more expressive code, you can add the following function to Date’s prototype: Date.prototype.equals =...