1.0.2 • Published 1 year ago

nuxt-dayjs v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Nuxt Dayjs

Install

Command

~$ npm i nuxt-dayjs

~$ yarn add nuxt-dayjs

Nuxt config

export default defineNuxtConfig({
  modules: ['nuxt-dayjs'],
})

Types

{
  "extends": "./.nuxt/tsconfig.json",
  "types": ["nuxt-dayjs"]
}

Usage examples

Config key

export default defineNuxtConfig({
  dayjs: {
    locales: ['ru'],
    defaultLocale: 'ru',
    defaultTimeZone: 'Europe/Moscow',
    plugins: ['utc', 'timezone'],
  }
})

Runtime config

export default defineNuxtConfig({
  runtimeConfig: {
    dayjs: {
      locales: ['ru'],
      defaultLocale: 'ru',
      defaultTimeZone: 'Europe/Moscow',
      plugins: ['utc', 'timezone'],
    }
  }
})

Component

import { useDayjs } from '#imports'

const dayjs = useDayjs()

Interfaces

interface NuxtDayjsOptions {
  locales?: string[]
  plugins?: string[]
  defaultLocale?: string
  defaultTimeZone?: string
}

interface NuxtConfig {
  dayjs?: NuxtDayjsOptions
}
1.0.2

1 year ago

1.0.1

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago