
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
@nuxtjs/dayjs
Advanced tools
The best way for use Day.js easily in your Nuxt.js project.
$ yarn add @nuxtjs/dayjs # or npm install
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
}
// ...
}
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>
Add the types to your "types"
array in tsconfig.json
after the @nuxt/types
entry.
For dayjs plugins, add their relative types like dayjs/plugin/_pluginName_
.
{
"compilerOptions": {
"types": [
"@nuxt/types",
"@nuxtjs/dayjs",
"dayjs/plugin/relativeTime",
]
}
}
$ git clone https://github.com/nuxt-community/dayjs-module.git
$ cd @nuxtjs/dayjs
$ yarn
MIT @potato4d
This project generated by create-nuxt-module
Thanks goes to these wonderful people (emoji key):
![]() Takuma HANATANI(@potato4d) 💻 🐛 📖 💡 💬 👀 | Bryan Daniel Velastegui Lucero 💻 | Wei 💻 | かずえもん 📖 | Daiki Ojima 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!
FAQs
The best way for use Day.js easily in your Nuxt.js project.
The npm package @nuxtjs/dayjs receives a total of 8,422 weekly downloads. As such, @nuxtjs/dayjs popularity was classified as popular.
We found that @nuxtjs/dayjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.