FormatDate

FormatDate

Shows a date neatly formatted in your site's language.

Shows a date neatly formatted in your site's language — for example '8 June 2026' instead of a bare date code. Handy for records with a date.

Use FormatDate whenever a record stores a raw date value — a publish date, an event date, a due date — and you want it shown the way a human reads dates in your site's language, instead of an ISO string like 2026-06-08. This matters most on multilingual sites, where "6/8/2026" and "8-6-2026" mean different days depending on the visitor's locale.

Common use: showing the publish date on a blog article, or an event date on a landing page, without maintaining separate date-formatting logic per language.

Where raw dates need formatting

On a webshop, FormatDate is the natural choice for a delivery estimate or a sale's end date pulled from a product record — showing "Sale ends 20 June" instead of a raw timestamp. On a portfolio site, it typically renders a case study's completion date under the project title. On a professional services site with published guides or news updates, it renders the publish date consistently across every article without each author having to type the date by hand in the right format.

A common mistake is displaying a date field's raw value directly instead of routing it through FormatDate — an ISO string or database timestamp reads fine to a developer but looks broken to a visitor. Another is mixing date styles inconsistently across a page, such as a long format in one place and a short numeric one elsewhere; picking one date-style per context (short for a listing, long for an article header) keeps the page visually consistent.

FormatDate is often used alongside a listing of records — a blog index, an events page, a Records block — where every item needs its date rendered the same way without repeating formatting logic per entry. On an article page itself, it commonly sits right under the title, sometimes next to a RecordNav pointing to the next or previous entry in a series.

The main benefit on a multilingual site is that the same stored value automatically reads correctly in every language variant of the page — no separate date string needs to be maintained per translation, and there's no risk of a US-style and a European-style date format appearing side by side and being misread.

date.jsx
<FormatDate value='2026-06-08' date-style='long' />