---
url: /documentation/input-types/datetime.md
description: >-
  Configure date and time inputs for date, time, datetime-local, month, or week
  values with minimum and maximum constraints.
---

# Date and Time Input

An input for datetime-related data.

```js
{
  input: {
    type: 'datetime', // [!code focus:2]
    aspect: 'date'
  }
}
```

## Input Options

| Option | Values | Default | Description |
| - | - | - | - |
| `aspect` | `'date' \| 'time' \| 'datetime-local' \| 'month' \| 'week'` | `'datetime-local'` | The aspect (input type) to select. Note that (at the time of writing) `month` and `week` are only supported in Chromium browsers. |
| `required` | `boolean` | `false` | Whether filling the field is mandatory. |
| `min` | `string` | - | The `min` input attribute. |
| `max` | `string` | - | The `max` input attribute. |
| `suggestions` | `string[]` | - | Suggested values for the field. |

## Conditions

The `datetime` input type supports the following conditions for [dynamic visibility](/documentation/concepts/elements/definition#dynamic-visibility):

| Condition | Payload | Description |
| - | - | - |
| `isEmpty` | `boolean`defaults to `true` | Checks whether a datetime has been selected or not. |
| `equals` | `string` | Checks whether the selected datetime equals the `payload` value. |
| `isBefore` | `string` | Checks whether the selected datetime lies before the `payload` value. |
| `isBeforeOrEqual` | `string` | Checks whether the selected datetime lies before or exactly at the `payload` value. |
| `isAfter` | `string` | Checks whether the selected datetime lies after the `payload` value. |
| `isAfterOrEqual` | `string` | Checks whether the selected datetime lies after or exactly at the `payload` value. |
