Skip to content

Date Field

A date picker with an optional time part.

Settings:

SettingWhat it does
Date formatHow the date is shown, MODX's manager format by default
Time formatThe same for time
Date typeHow the value is stored — see below
Disabled datesDates to grey out, comma-separated
Disabled daysDays of the week to grey out: 0 is Sunday, 6 is Saturday
Hide timeDrop the time part and keep only the date
Min. time, Max. timeBounds for the time list
Time incrementStep of that list in minutes, 15 by default

How it is stored matters

Date type decides the shape of the value:

  • datetime (default) — a string, 2026-09-12 14:30:00. Readable, sorts correctly as text, prints without ceremony.
  • timestamp — a number of seconds. Convenient for arithmetic, unreadable on its own.

Pick one before there is data. Changing it later means converting every row that already exists.

Output:

html
<time datetime="{$published}">{$published|date_format:'%d.%m.%Y'}</time>

Disabled dates and days shape the picker, not the value

They grey out cells in the calendar. They are not a validation rule — a date written through the REST API or an import lands as given.

© PageBlocks 2019-present