DateTime
Show Date and Time in Calendary way or use as a Picker to select one
Installation
npm install --save @gladio/datetime
Usage
import DateTime from "@gladio/datetime"function App () {return <DateTime />}
Components
Following components are exported from @gladio/datetime module.
DateTime
DateTime component is the base component which allows selection of dates and times. Date format can be passed with
a combination of dateFormat and timeFormat props. Passing any of them as true enable that type of component and
setting it to false disable that type.
dateFormat defaults to
truewhereas timeFormat defaults tofalse
A string value can also be passed as the format for these props e.g. dateFormat="DD MMM, YYYY", timeFormat="HH:mm A".
| July 2021 | ‹ | › | ||||
|---|---|---|---|---|---|---|
| Su | Mo | Tu | We | Th | Fr | Sa |
| 27 | 28 | 29 | 30 | 1 | 2 | 3 |
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
| 12:00 AM | ||||||
DateTimeInput
Instead of using a native <input type="date" />, you can use the DateTimeInput component which render a input with
the DateTime component. Native inputs have different UI/UX and are not will supported. You can pass all other props
accepted by DateTime base component like formats, value, onChange etc.
DateTimePicker
To have a fine control over what is rendered by the DateTimeInput, we can use the DateTimePicker component that let's
you render a customized component as the toggler. It default to rendering a button component.