DateTime

The "DateTime" type generates a simple <input> field, which provides a date picker.

It corresponds with the TCA type='inputDateTime' (default) and eval='datetime'.

Properties

default

| Required: false | Type: string | Default: '' |

Default value set if a new record is created.

displayAge

| Required: false | Type: boolean | Default: true |

If set, enables the display of the age (p.e. “2015-08-30 (-27 days)”) of date fields. Invert state of TCA's disableAgeDisplay property.

range

| Required: false | Type: array | Default: '' |

An array which defines an integer range within which the value must be. Keys:

lower (string in format H:i dd-mm-yyyy)

Defines the lower integer value. Default: 0.

upper (string in format H:i dd-mm-yyyy)

Defines the upper integer value. Default: 100.

It is allowed to specify only one of both of them.

Example:

range:
  lower: '00:01 01-01-1970'
  upper: '29:59 31-12-2020'
required

| Required: false | Type: boolean | Default: 'false' |

If set, the field will become mandatory.

size

| Required: false | Type: integer | Default: '20' |

Abstract value for the width of the <input> field.

trim

| Required: false | Type: boolean | Default: 'false' |

If set, the PHP trim function is applied on the field's content.

Example

group: common
fields:
  - identifier: datetime
    type: DateTime
    properties:
      default: '2020-12-12'
      displayAge: true
      range:
        lower: '2019-01-31 12:00:00'
        upper: '2040-01-31 12:00:00'
      required: false
      size: 20
      trim: true