1 import { DAY } from '@proton/shared/lib/constants';
3 import startOfDay from './startOfDay';
5 const differenceInCalendarDays = (left: Date, right: Date) => {
6 const startOfDayLeft = startOfDay(left);
7 const startOfDayRight = startOfDay(right);
9 const diff = startOfDayLeft.getTime() - startOfDayRight.getTime();
11 return Math.round(diff / DAY);
14 export default differenceInCalendarDays;