https://github.com/nathanchase/dayjs
Dayjs module for Nuxt 3
https://github.com/nathanchase/dayjs
dayjs nuxt nuxtjs
Last synced: about 1 year ago
JSON representation
Dayjs module for Nuxt 3
- Host: GitHub
- URL: https://github.com/nathanchase/dayjs
- Owner: nathanchase
- Created: 2022-07-25T16:03:27.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2025-04-07T18:18:13.000Z (about 1 year ago)
- Last Synced: 2025-04-09T20:08:34.077Z (about 1 year ago)
- Topics: dayjs, nuxt, nuxtjs
- Language: TypeScript
- Homepage:
- Size: 995 KB
- Stars: 30
- Watchers: 2
- Forks: 5
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# @nathanchase/nuxt-dayjs-module
This is a Nuxt 3 compatible module built with the official Nuxt 3 [module-builder](https://github.com/nuxt/module-builder) for [dayjs](https://github.com/iamkun/dayjs/). This is meant as a Nuxt 3 version of [dayjs-module](https://github.com/nuxt-community/dayjs-module) to satisfy [Nuxt 3 support](https://github.com/nuxt-community/dayjs-module/issues/376).
Usage:
```js
// ./nuxt.config.ts
export default defineNuxtConfig({
modules: [
'@nathanchase/nuxt-dayjs-module'
]
...
});
```
Add dayjs plugins (ex: [duration](https://day.js.org/docs/en/plugin/duration)) via configuration in nuxt.config like so:
```js
dayjs: {
plugins: [
'duration',
'relativeTime',
'advancedFormat',
'weekday'
]
}
```
See [/playground/app.vue](https://github.com/nathanchase/dayjs/blob/master/playground/app.vue) for working examples.
On npm: [https://www.npmjs.com/package/@nathanchase/nuxt-dayjs-module](https://www.npmjs.com/package/@nathanchase/nuxt-dayjs-module)
## Development
- Run 'npm install' to install required packages.
- Run `npm run dev:prepare` to generate type stubs.
- Use `npm run dev` to start [playground](./playground) in development mode.
```