1.0.3 • Published 2 years ago

@initred/nuxt3-dayjs v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

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.