Basic example
Input with a modal for selecting a date and time.
Inline version
You can use inline version with option data-twe-inline
.
Disabled
Use data-twe-disabled="true"
attribute on Datetimepicker to
remove pointer events.
Add the disabled boolean attribute on an input with
bg-neutral-200
and dark:bg-neutral-600
classes to
give it a neutraled out appearance and remove pointer events and make it
unusable and un-clickable.
Disable past
Use data-twe-disable-past="true"
attribute to disallow
selecting past dates.
Disable future
Use data-twe-disable-future="true"
attribute to disallow
selecting future dates.
Default values
You can set default date and time with options defaultDate
and
defaultTime
.
Input toggle
Add data-twe-date-timepicker-toggle-ref
to the input element to
enable toggling on input click. It is also possible to set
toggleButton
option to false
to remove the toggle
button.
Custom date and time options
Use datepicker
or timepicker
option to set custom
options from our
Datepicker
and
Timepicker
components.