Need to compare two dates and check if it is the same day? Here is how you can do it.
function datesAreTheSameDay(date1: Date, date2: Date): boolean { return date1.toDateString() === date2.toDateString(); }
toDateString()