toLocaleDateString('pt-PT')
to convert ISO-formatted CMS dates into Portuguese by targeting elements with a data-date
attribute.To change the language of publication dates (e.g., "January 15, 2024") from English to Portuguese in a Webflow CMS Collection, you need to manually localize the date format.
Webflow currently does not natively support multi-language date formatting, so you must use a small custom script to format CMS dates.
toLocaleDateString()
method.pt-PT
or pt-BR
locale codes.Example inline usage with JavaScript:
const dateElements = document.querySelectorAll('[data-date]');dateElements.forEach(el => { const date = new Date(el.getAttribute('data-date')); el.textContent = date.toLocaleDateString('pt-PT', { year: 'numeric', month: 'long', day: 'numeric' });});
Then in your Webflow CMS collection page, do this:
Publish Date
)data-date
{{ Published Date }}
without formatting)This will let your custom script read the ISO date and convert it to Portuguese.
If you're not comfortable using code:
Published Date
.This is not scalable, but works for a few items.
If your site has broader multilingual needs:
Webflow CMS doesn't automatically localize dates, so you must use a custom JavaScript script with toLocaleDateString('pt-PT')
for proper formatting. Alternatively, manually enter formatted dates or use third-party translation tools for full localization.