This package has been deprecated

Author message:

This package has been moved to @nuxtjs/dayjs. Please use @nuxtjs/dayjs.

nuxt-dayjs-module
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

nuxt-dayjs-module

code style: prettier donate: Patreon License: MIT NPM version All Contributors NPM downloads codecov

The best way for use Day.js easily in your Nuxt.js project.

Installation

$ yarn add nuxt-dayjs-module # or npm install 

Usage

1. Register dayjs module to your Nuxt Application

export default {
  // ...
  modules: [
    'nuxt-dayjs-module'
  ],
 
  // Optional
  dayjs: {
    locales: ['en', 'ja'],
    defaultLocale: 'en'
  }
  // ...
}

2. Use $dayjs on Context, Vue instance

with Context

<script>
export default {
  asyncData({ $dayjs }) {
    return {
      now: $dayjs().format('YYYY/MM/DD')
    }
  }
}
</script> 

with Vue instance

<script>
export default {
  data() {
    return {
      latestClicked: null
    }
  },
  methods: {
    handleClickButton() {
      this.latestClicked = this.$dayjs().format('YYYY/MM/DD')
    }
  }
}
</script> 

Development

$ git clone https://github.com/potato4d/nuxt-dayjs-module.git
cd nuxt-dayjs-module
$ yarn

License

MIT @potato4d

Note

This project generated by create-nuxt-module

Contributors

Thanks goes to these wonderful people (emoji key):

Takuma HANATANI(@potato4d)
Takuma HANATANI(@potato4d)

💻 🐛 📖 💡 💬 👀

This project follows the all-contributors specification. Contributions of any kind welcome!

Readme

Keywords

Package Sidebar

Install

npm i nuxt-dayjs-module

Weekly Downloads

222

Version

1.1.2

License

MIT

Unpacked Size

15.3 kB

Total Files

15

Last publish

Collaborators

  • potato4d