import "../../FabricInit"; import { IDatePickerProps, IDatePickerStrings, IDatePicker } from "office-ui-fabric-react/lib/DatePicker"; import { IFilterBarItem, IFilterBarItemProps } from '../../FilterBarItem'; export interface IDateTimePickerProps extends IDatePickerProps { /** * Initial value for the control. This is passed on to the DatePicker's "value" prop and the TextField's "defaultValue" prop, * both of which correspond to the uncontrolled version of the controls. The DatePicker currently does not support a controlled * version, so neither does the DateTimePicker, for now. */ defaultValue?: Date; /** * Optional method to format the chosen time to a string to display in the TextField */ formatTime?: (date: Date) => string; /** * Optional method to parse the text input value to time */ parseTimeFromString?: (timeStr: string) => Date | null; /** * Callback issued when the date/time is changed legally */ onValueChanged?: (date: Date) => void; /** * Optional string for aria label on the date field */ dateAriaLabel?: string; /** * Class to apply to the date picker field */ dateFieldClassName?: string; /** * Use this prop if you want the DateTimePicker to purely act as a wrapper * around the OfficeFabric DatePicker component. * * @default false */ dateOnly?: boolean; /** * Optional string for aria label on the time field */ timeAriaLabel?: string; /** * Class to apply to the time field */ timeFieldClassName?: string; /** * Key for FilterBarItem. If this is changed, will always update state with new props. */ setKey?: string; /** * Earliest date pickable on the calendar (does not affect the time input) */ minDate?: Date; /** * Latest date pickable on the calendar (does not affect the time input) */ maxDate?: Date; } export interface IDateTimePickerStrings { /** * Error message to render for time TextField if input time string parsing fails. */ cannotParseTime?: string; } export interface IDateTimePickerFilterBarItemProps extends IDateTimePickerProps, IFilterBarItemProps { componentRef?: (component: IDatePicker & IFilterBarItem) => void; }