We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I would like to change the format for relativeTime: https://day.js.org/docs/en/customization/relative-time. But i dont know how implement in nuxtconfig
The text was updated successfully, but these errors were encountered:
Make a dayjs.js file in plugins folder and write code below.
dayjs.js
plugins
export default function ({ $dayjs }) { $dayjs.updateLocale('en', { relativeTime: { future: 'in %s', past: '%s ago', s: 'a few seconds', m: 'a minute', mm: '%d minutes', h: 'an hour', hh: '%d hours', d: 'a day', dd: '%d days', M: 'a month', MM: '%d months', y: 'a year', yy: '%d years', }, }) }
And add this plugin to nuxt.config.js.
nuxt.config.js
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins plugins: [ '~/plugins/dayjs'],
Finally, add updateLocale to dayjs config in nuxt.config.js
... dayjs: { locales: ['en'], defaultLocale: 'en', defaultTimeZone: 'America/New_York', plugins: ['timezone', 'relativeTime', 'updateLocale'], }, ...
Sorry, something went wrong.
@k4sud0n How to use in nuxt3?
No branches or pull requests
I would like to change the format for relativeTime: https://day.js.org/docs/en/customization/relative-time. But i dont know how implement in nuxtconfig
The text was updated successfully, but these errors were encountered: