import type { DateRange } from 'react-day-picker' import { parseDateInputValue } from '@admin/utils/date/parse-date-input-value' export function buildDateRange(from?: string, to?: string): DateRange | undefined { const fromDate = parseDateInputValue(from) const toDate = parseDateInputValue(to) if (!fromDate && !toDate) return undefined return { from: fromDate, to: toDate } }