UNPKG

@blueprintjs/datetime

Version:

Components for interacting with dates and times

38 lines (25 loc) 1.21 kB
@# Date time picker `DateTimePicker` composes a [`DatePicker`](#datetime/datepicker) and a [`TimePicker`](#datetime/timepicker) into one container. <div class="@ns-callout @ns-intent-danger @ns-icon-error"> <h5 class="@ns-heading"> Deprecated: use [Date picker](#datetime/datepicker) </h5> This component is **deprecated since @blueprintjs/datetime v3.2.0** with the addition of `<DatePicker>` `timePrecision` and `timePickerProps` props to trivially compose time selection with the existing date selection. </div> @reactExample DateTimePickerExample @## Props Use the `onChange` prop to listen for changes to the selected date and time. You can control the selected date and time by setting the `value` prop, or use the component in uncontrolled mode and specify an initial day by setting `defaultValue`. (If `defaultValue` is not set, the current date and time is used as the default.) You can pass props to the inner `DatePicker` and `TimePicker` components using `datePickerProps` and `timePickerProps`, respectively. ```tsx import { DateTimePicker } from "@blueprintjs/datetime"; <DateTimePicker value={this.state.date} onChange={this.handleDateChange} /> ``` @interface IDateTimePickerProps