UNPKG

apphouse

Version:

Component library for React that uses observable state management and theme-able components.

61 lines (60 loc) 2.01 kB
import React from 'react'; import { InputProps } from '../input/input.interface'; interface DatePickerProps extends Pick<InputProps, 'variant' | 'label' | 'id' | 'required' | 'disabled' | 'description' | 'styleOverwrites'> { onDateSelect: (date: string) => void; /** * A string representing the date entered in the input. * The date is formatted according to Date strings format. * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Date_and_time_formats#date_strings * @default undefined * @optional */ value?: string; /** * The minimum date that the user can select. * @default undefined user can select any date */ min?: string; /** * The maximum date that the user can select. * @default undefined user can select any date */ max?: string; /** * The name of the input. */ name?: string; /** * The width of the input. * @default undefined * @optional */ width?: string | number; } /** * A wrapper on the input date element. * It augments the input with a label and description. * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date * Date format: June 7, 2005 * const dateString = '2005-06-07'; * * Time format: 8:45 AM * const timeString1 = '08:45'; * * Time format with seconds: 8:45 AM and 25 seconds * const timeString2 = '08:45:25'; * * Time format with date and time: 3:40 AM on August 4, 33 * const dateTimeString1 = '0033-08-04T03:40'; * * Time format with date, time, and seconds: 30 seconds after 2:00 PM on April 1, 1977 * const dateTimeString2 = '1977-04-01T14:00:30'; * * Time format with UTC: Midnight UTC on January 1, 1901 * const dateTimeString3 = '1901-01-01T00:00Z'; * * Time format with timezone offset: 1 second past midnight Eastern Standard Time (EST) on January 1, 1901 * const dateTimeString4 = '1901-01-01T00:00:01-04:00'; */ export declare const DatePicker: React.FC<DatePickerProps>; export {};