param date param hours param minutes param seconds export function changeTimeToMidnight ( date ) { const newDate = new Date ( date . getTime ( ) ) ; newDate . setHours ( 0 ) ; newDate . setMinutes ( 0 ) ; newDate . setSeconds ( 0 ) ; newDate . setMilliseconds ( 0 ) ; return newDate ; }