All Projects → nuxt-community → Dayjs Module

nuxt-community / Dayjs Module

Licence: mit
Official Day.js module for your Nuxt.js project.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Dayjs Module

Nuxt User Agent
Nuxt.js module for handling User-Agent.
Stars: ✭ 102 (-8.11%)
Mutual labels:  nuxt, nuxtjs
Google Gtag Module
Enable google gtagjs for NuxtJs
Stars: ✭ 106 (-4.5%)
Mutual labels:  nuxt, nuxtjs
Nuxt Tailwind
A Nuxt.js starter project template using Tailwind CSS without the distraction of a complicated development environment.
Stars: ✭ 71 (-36.04%)
Mutual labels:  nuxt, nuxtjs
Laravel Vuejs.com
Laravel and VueJs Blog, using Laravel nova, GraphQL, NuxtJs, Apollo and ...more
Stars: ✭ 54 (-51.35%)
Mutual labels:  nuxt, nuxtjs
Lichter.io
My own website and CV
Stars: ✭ 105 (-5.41%)
Mutual labels:  nuxt, nuxtjs
Nuxt Compress
A simple static asset compression module for Nuxt that runs Gzip and Brotli compression during the build process
Stars: ✭ 61 (-45.05%)
Mutual labels:  nuxt, nuxtjs
Nuxt Chat App
Frontend of real-time chat application built using nuxtjs, socket.io. Check the backend at https://github.com/binbytes/chat-app-server.
Stars: ✭ 77 (-30.63%)
Mutual labels:  nuxt, nuxtjs
Realworld Nuxt
Nuxt.js implementation of RealWorld Frontend
Stars: ✭ 45 (-59.46%)
Mutual labels:  nuxt, nuxtjs
Example Ecommerce Snipcart Vue
The Transglobal Candy Store: Sample front-end for the Sanity.io e-commerce schema with vue.js, nuxt.js, and snipcart
Stars: ✭ 89 (-19.82%)
Mutual labels:  nuxt, nuxtjs
Nuxt Graphql Request
Easy Minimal GraphQL client integration with Nuxt.js.
Stars: ✭ 85 (-23.42%)
Mutual labels:  nuxt, nuxtjs
Eslint Module
ESLint module for Nuxt.js
Stars: ✭ 49 (-55.86%)
Mutual labels:  nuxt, nuxtjs
Vue Api Query
💎 Elegant and simple way to build requests for REST API
Stars: ✭ 1,528 (+1276.58%)
Mutual labels:  nuxt, nuxtjs
Pwa Module
Zero config PWA solution for Nuxt.js
Stars: ✭ 1,033 (+830.63%)
Mutual labels:  nuxt, nuxtjs
Nuxt Netlify
Dynamically generate `_headers` and `_redirects` files for Netlify in your Nuxt.js projects
Stars: ✭ 97 (-12.61%)
Mutual labels:  nuxt, nuxtjs
Nuxt Box
Truffle, Nuxt and Vue boilerplate
Stars: ✭ 46 (-58.56%)
Mutual labels:  nuxt, nuxtjs
Docker Nuxt
Docker image to run NUXT.js application in production mode
Stars: ✭ 71 (-36.04%)
Mutual labels:  nuxt, nuxtjs
Quickjam
Starter template for Nuxt apps bundled with an API
Stars: ✭ 42 (-62.16%)
Mutual labels:  nuxt, nuxtjs
Virapro.ru
[E-commerce] Plumbing Store
Stars: ✭ 45 (-59.46%)
Mutual labels:  nuxt, nuxtjs
Vue Masonry Wall
A pure vue responsive masonry layout without direct dom manipulation and ssr support.
Stars: ✭ 79 (-28.83%)
Mutual labels:  nuxt, nuxtjs
Sails Nuxt
Sails + Nuxt + Vuetify Combo <3
Stars: ✭ 92 (-17.12%)
Mutual labels:  nuxt, nuxtjs

@nuxtjs/dayjs

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 @nuxtjs/dayjs # or npm install

Usage

1. Register dayjs module to your Nuxt Application

export default {
  // ...
  modules: [
    '@nuxtjs/dayjs'
  ],

  // Optional
  dayjs: {
    locales: ['en', 'ja'],
    defaultLocale: 'en',
    defaultTimeZone: 'Asia/Tokyo',
    plugins: [
      'utc', // import 'dayjs/plugin/utc'
      'timezone' // import 'dayjs/plugin/timezone'
    ] // Your Day.js plugin
  }
  // ...
}

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>

For Typescript users

Add the types to your "types" array in tsconfig.json after the @nuxt/types entry.

tsconfig.json

{
  "compilerOptions": {
    "types": [
      "@nuxt/types",
      "@nuxtjs/dayjs"
    ]
  }
}

Development

$ git clone https://github.com/nuxt-community/dayjs-module.git
$ cd @nuxtjs/dayjs
$ yarn

License

MIT @potato4d

Note

This project generated by create-nuxt-module

Contributors

Thanks goes to these wonderful people (emoji key):


Takuma HANATANI(@potato4d)

💻 🐛 📖 💡 💬 👀

Bryan Daniel Velastegui Lucero

💻

Wei

💻

かずえもん

📖

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].