Datetime

A date and time picker field

The datetime field generates two simple inputs consisting of the date field and the time field.

Example

fields:
  datetime:
    label: Date and Time
    type:  datetime

Format and interval

You can change the date format (default: YYYY-MM-DD), the time format (12/24) and the interval (set in minutes):

fields:
  datetime:
    type:  datetime
    date:
      format: DD-MM-YYYY
    time:
      format: 12
      interval: 15

Since version 2.3.0 you can set the default for date and time separately:

datetime:
  type: datetime
  default:
    date: now
    time: 19.30

2.5.0 +

Override

Setting the override option will always select the default instead of the already saved value, so that on saving the page again, it will be overridden with the default value.

fields:
  datetime:
    type: datetime
    default: today
    override: true