The JavaScript Date object compare dates with time including, so, if you compare:
time1.getTime() === time2.getTime()
, they'll be "false" if at least one millisecond is different.
What we need is to have a nice way to compare by Hour, Day, Week, Month, Year?
Some of them are easy, like year: time1.getYear() === time2.getYear()
but with day, month, hour it is more complex, as it requires multiple validations or divisions.
Is there any nice module or optimized code for doing those comparisons?