Radical Design Course by Jack McDade

From the creator of Statamic

Learn how to make your websites standout and be remembered.

Just exceptional. Thank you so much, Jack, you smashed it.

— Hugo, Developer

iso_format Modifier

Given a date string, or anything that even sorta kinda looks like a date string, will convert it to a Carbon instance and allow you to format it with ISO format. This allows you to use inner translations rather than language packages you need to install on every machine where you deploy your site.

The language that will be used for translations depends on what you configured in your config/statamic/sites.php file. The locale and fallback_locale settings from the config/app.php file have no influence on this modifier.

This is also compatible with momentjs format method, it means you can use same format strings as you may have used in moment from your front-end or other node.js application.

Check out the complete list of available replacements.

event_date: June 19 2020
{{ event_date | iso_format("MMMM Do YYYY, h:mm:ss a")}}
June 15th 2018, 5:34:15 pm

You can use macro-formats to format and localize dates as well.

{{ event_date | iso_format('ll') }}

Will output this on your English site:

Jan 5, 2017

And this on your French site:

5 janv. 2017

Check out the complete list of available macro-formats.

Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →