@spark-web/date-picker
Version:
--- title: DatePicker storybookPath: forms-date-picker isExperimentalPackage: true ---
21 lines (20 loc) • 922 B
TypeScript
/** Formats a date to 'dd/MM/yyyy'. */
export declare function formatDate(date: string | number | Date): string;
/** Formats a date object into a more human readable form. */
export declare function formatHumanReadableDate(date: Date): string;
/** Checks whether a value is a Date. */
export declare function isDate(value: unknown): value is Date;
/**
* Returns a date parsed from a string that is in 'dd/MM/yyyy' format.
*
* @see https://github.com/date-fns/date-fns/issues/942
*/
export declare function parseDate(value: string): Date | undefined;
/**
* Constrains a date to be within a range:
*
* @see
* [min](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date#min)
* and [max](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date#max).
*/
export declare function constrainDate(date: Date | undefined, minDate: Date | undefined, maxDate: Date | undefined): Date | undefined;