The Date prototype has an API that allows you to check the year, month, and day of the month, which seems simple and efficient.
You will need to decide whether your application should match the dates in terms of the locale where your code is running, or if the comparison should be based on UTC values.
function sameDay(d1, d2) { return d1.getFullYear() === d2.getFullYear() && d1.getMonth() === d2.getMonth() && d1.getDate() === d2.getDate(); }
The corresponding UTC coefficients are getUTCFullYear() , getUTCMonth() and getUTCDate() .
source share