Back to Woocommerce

DateTimePickerControl

packages/js/components/src/date-time-picker-control/README.md

10.8.0-dev1.2 KB
Original Source

DateTimePickerControl

Add a component to allow selecting of a date and time via a calendar selection or by manual input.

Usage

jsx
<DateTimePickerControl
	onChange={ ( date ) => console.log( date ) }
	dateFormat="DD-MM-YYYY H:MM"
/>

Props

NameTypeDefaultDescription
currentDateStringnullA date in ISO format to be used as the initially set date
dateTimeFormatStringMM/DD/YYYY h:mm aThe format used for the datetime
disabledBooleannullWhether the input is disabled
is12HourBooleantrueWhether the date time picker should show a 12 or 24 hour format
onChangeFunctionundefined(required) A function called upon selection of a date or input change
popoverPropsObject{}Props that will be sent to the Dropdown component