// make use of date-fns
const date1 = endOfDay(dateToCompare) // passed date with time 00:00
const date2 = endOfDay(new Date()) // get current Date with time 00:00
if (isAfter(date1, date2)) {
console.log(`The passed Date: ${date1} lies in the future`
}