import { format } from 'date-fns' import { DateRange } from 'react-day-picker' type Props = { calendarRange?: DateRange } export const parseDates = ({ calendarRange }: Props) => calendarRange?.to && calendarRange?.from ? `${format(calendarRange.from, 'dd.MM.yyyy')} - ${format(calendarRange.to, 'dd.MM.yyyy')}` : null