Localized date on frontend

Hello there.

How to ensure my dates are translated correctly?

I’ve set the blog post date to be localized in the models.

I see this in the compontents/date.js (took the next.js-i18n-blog-demo)
import { parseISO, format } from ‘date-fns’

export default function Date({ dateString }) {
const date = parseISO(dateString)
return {format(date, ‘LLLL d, yyyy’)}

Yet on the front end, In all my languages, I see the date as February 8, 2023
Ideally, it would be translated to the correct month name in my language.

Not sure what to do.
Thank you.

Hello there? Am I allowed to bump this? Or is this not a DatoCMS issue?

Hello @ZeroEqualsZero

Sorry for the delay on this:

I think what you’re looking for can be accomplished with this NPM package:

With it, you can format dates and specify the locale to have the desired outcome, as such:

formatDate(date, 'YYYY, MMMM dddd DD', { locale: 'fr' })
// → 1984, Janvier Mercredi 18

Oh! Great. Thank you.