I am trying to localize DateTime with Nuxt/i18n,
but it doesn't work!
This is what I have in the config of Nuxt/i18n in nuxt config:
{
seo: true,
locales: [
{
code: 'en',
iso: 'en-US',
file: 'en.js',
dir: 'ltr',
name: 'English',
id: 2,
}
],
lazy: true,
langDir: 'locales/',
defaultLocale: 'en',
strategy: 'prefix_except_default',
dateTimeFormats: {
'en-US': {
short: {
year: 'numeric',
month: 'long',
day: 'numeric',
weekday: 'short',
},
long: {
year: 'numeric',
month: 'short',
day: 'numeric',
weekday: 'short',
hour: 'numeric',
minute: 'numeric',
},
},
},
},
How can I fix this?
{{ $d(new Date(), 'short') }}
``` for localization But it doesn't work – morteza mortezaie Oct 18 '21 at 07:30