UNPKG

@leafygreen-ui/date-utils

Version:
20 lines 782 B
import { DateType } from '../types'; import { InvalidDate } from '../types/InvalidDate'; /** * An extension of `date-fns` {@link isValid} * that accepts a {@link DateType} */ export declare const isValidDate: (date?: DateType) => date is Date; /** * Returns whether the provided string is a valid date * * @deprecated Prefer {@link isValid} from `date-fns` */ export declare const isValidDateString: (str?: any) => str is string; /** Whether the given object is a `Date` object */ export declare const isDateObject: (date: any) => date is Date | InvalidDate; /** * Returns whether a given object is a Date object that will print `"Invalid Date"` */ export declare const isInvalidDateObject: (date: DateType) => date is InvalidDate; //# sourceMappingURL=isValidDate.d.ts.map