Date is same as another date

OSCC · JavaScript, Date · Nov 3, 2020

Checks if a date is the same as another date.

const isSameDate = (dateA, dateB) =>
  dateA.toISOString() === dateB.toISOString();
isSameDate(new Date(2010, 10, 20), new Date(2010, 10, 20)); // true

Recommended snippets & collections