javaScript проверьте, прошло ли он полуночи
//A simple solution to check whether two dates represent the same day is:
const isSameDay = (a, b) => return a.toDateString() === b.toDateString();
// This works no matter what the distance between the two dates is.
Inexpensive Impala