UNPKG

2.06 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/**
43 * Date time picker component.
44 *
45 * @see https://blueprintjs.com/docs/#datetime/datetimepicker
46 * @deprecated since 3.4.0. Prefer `<DatePicker>` with `timePrecision` and `timePickerProps`.
47 */
48export declare class DateTimePicker extends AbstractPureComponent2<IDateTimePickerProps, IDateTimePickerState> {
49 static defaultProps: IDateTimePickerProps;
50 static displayName: string;
51 constructor(props?: IDateTimePickerProps, context?: any);
52 render(): JSX.Element;
53 componentDidUpdate(prevProps: DatePickerProps): void;
54 handleDateChange: (dateValue: Date, isUserChange: boolean) => void;
55 handleTimeChange: (timeValue: Date) => void;
56}