import { DatePart, DatePartValues } from './types'; export interface LocaleMeta { partsOrder: DatePart[]; separator: string; } /** * Parse a given string into a JS Date instance. The date is expected to be in ISO-8601 * YYYY-MM-DD format, or formatted according to the locale if the meta was passed. Note that * single digit months or days are zero-padded automatically, meaning YYYY-M-D is also a valid * format. * * If no date could be parsed (either because it's incomplete, wrong format or just * non-sensical), returns `null`. */ export declare const parseDate: (value: string, meta?: LocaleMeta) => Date | null; /** * Format date parts into an (unvalidated) ISO-8601 string. */ export declare const partsToUnvalidatedISO8601: (parts: DatePartValues) => string; /** * Given a locale, figure out the order of date parts and what the separator used is. * * This uses a dummy date to format it with the provided locale using the native Intl * APIs and extracts the order from the formatted date. */ export declare const getDateLocaleMeta: (locale: string) => LocaleMeta; /** * Determine the "best" initial date for the date picker. * * Given the (optional) minimum and maximum bounds, pick the bound that should lead * to the least amount of clicks for the user to get to a valid date. There are a * number of cases to consider here that prevent use from using date-fns `min` helper: * * - for a max date in the past, use the max date so the user doesn't have to skip over * all days between the past max date & now * - for a min date in the future, a similar case applies * - when both min and max date are specified and today falls within the interval - * don't use any of the bounds, as the date picker defaults to the current date */ export declare const getBestInitialDate: (minDate: Date | undefined, maxDate: Date | undefined) => Date | undefined;