import { isNil } from "../../shared" ; export function areEqualDates ( x , y ) { return x ?. getTime ( ) === y ?. getTime ( ) ; } export function toMidnightDate ( date ) { if ( ! isNil ( date ) ) { const newDate = new Date ( date . getTime ( ) ) ; newDate . setHours ( 0 , 0 , 0 , 0 ) ; return newDate ; } return null ; }