@initred/nuxt3-dayjs
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Nuxt3 dayjs Module

dayjs module for nuxt v3

defaults config

export default defineNuxtModule<ModuleOptions>({
  defaults: {
    locales: [],
    defaultLocale: 'en',
    plugins: [
      'utc',
      'timezone'
    ],
    defaultTimezone: null
  }
})

How to use

export default defineNuxtConfig({
    modules: [
        '@initred/nuxt3-dayjs',
    ],
    dayjs: {
        locales: ['en', 'ko'],
        defaultLocale: 'ko',
        defaultTimezone: 'America/New_York',
        plugins: [
            'relativeTime',
            'isoWeek',
            'utc',
            'weekday',
            'isToday',
            'isSameOrBefore',
            'isSameOrAfter',
            'localizedFormat',
            'timezone',
            'updateLocale',
            'localeData',
        ],
    },   
],

Development

  • Run npm run dev:prepare to generate type stubs.
  • Use npm run dev to start playground in development mode.

Package Sidebar

Install

npm i @initred/nuxt3-dayjs

Weekly Downloads

7

Version

1.0.3

License

MIT

Unpacked Size

4.95 kB

Total Files

9

Last publish

Collaborators

  • initred