UNPKG

1.97 kBTypeScriptView Raw
1/// <reference types="react" />
2import { AbstractPureComponent2, Props } from "@blueprintjs/core";
3import { DatePickerProps } from "./datePicker";
4import { TimePickerProps } from "./timePicker";
5export interface IDateTimePickerProps extends Props {
6 /**
7 * The initial date and time value that will be set.
8 * This will be ignored if `value` is set.
9 *
10 * @default Date.now()
11 */
12 defaultValue?: Date;
13 /**
14 * Any props to be passed on to the `DatePicker` other than the `value` and `onChange` props as they come directly
15 * from the `DateTimePicker` props.
16 */
17 datePickerProps?: DatePickerProps;
18 /**
19 * Callback invoked when the user changes the date or time.
20 */
21 onChange?: (selectedDate: Date, isUserChange: boolean) => void;
22 /**
23 * Any props to be passed on to the `TimePicker` other than the `value` and `onChange` props as they come directly
24 * from the `DateTimePicker` props.
25 */
26 timePickerProps?: TimePickerProps;
27 /**
28 * The currently set date and time. If this prop is provided, the component acts in a controlled manner.
29 */
30 value?: Date | null;
31 /**
32 * Allows the user to clear the selection by clicking the currently selected day.
33 *
34 * @default true
35 */
36 canClearSelection?: boolean;
37}
38export interface IDateTimePickerState {
39 dateValue?: Date;
40 timeValue?: Date;
41}
42/** @deprecated since 3.4.0. Prefer `<DatePicker>` with `timePrecision` and `timePickerProps`. */
43export declare class DateTimePicker extends AbstractPureComponent2<IDateTimePickerProps, IDateTimePickerState> {
44 static defaultProps: IDateTimePickerProps;
45 static displayName: string;
46 constructor(props?: IDateTimePickerProps, context?: any);
47 render(): JSX.Element;
48 componentDidUpdate(prevProps: DatePickerProps): void;
49 handleDateChange: (dateValue: Date, isUserChange: boolean) => void;
50 handleTimeChange: (timeValue: Date) => void;
51}