Skip to content

DateField

Displays a date/time value using Intl.DateTimeFormat. Lets you control whether to show the date part, the time part, or both.

import { DateField } from '@/components/admin';
<DateField source="published_at" />

The locales and options props are passed to Intl.DateTimeFormat. See Date.toLocaleDateString() on MDN for details.

<DateField source="published_at" options={{
weekday: 'long',
year: 'numeric',
month: 'long',
day: 'numeric'
}} />
// renders the record { id: 1234, published_at: new Date('2017-04-23') } as
<span>Sunday, April 23, 2017</span>

For date‑only strings (YYYY-MM-DD) it forces UTC to avoid timezone shift.

PropRequiredTypeDefaultDescription
sourceRequiredstring-Field name
defaultValueOptionalany-Fallback when no value
emptyOptionalReactNode-Placeholder when no value
localesOptionalIntl.LocalesArgumentBrowser localeLocale(s)
optionsOptionalIntl.DateTimeFormatOptions-Formatting options
recordOptionalobjectRecord from contextExplicit record
showDateOptionalbooleantrueDisplay date part
showTimeOptionalbooleanfalseDisplay time part
transformOptional(value)=>DateParse Date/number/stringTransform raw value to Date

Remaining props are passed to the underlying <span> (e.g., className).

If your API returns timestamps or ISO strings, the default transform will produce a proper Date. Override it for custom parsing.