question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

If I get more time I will make this a PR.

I have written a DayJS plugin for nuxt3 and so far its working pretty well:

plugnis/dayjs.ts

import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime.js'
import { defineNuxtPlugin } from '#app'

export default defineNuxtPlugin((nuxtApp) => {
  dayjs.extend(relativeTime)
  nuxtApp.provide('dayjs', dayjs)
})

declare module '#app' {
  interface NuxtApp {
    $dayjs: dayjs.Dayjs
 }
}

I assume next steps are to transfer this into the template/runtime format and plug in the locale config.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:19
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
JoaoPedroAS51commented, Aug 29, 2022

Hi @potato4d! I was working on a Nuxt 3 version of this module a while ago. Would you be interested in taking a look? It has useDayjs() composable and auto register of dayjs types.

4reactions
nathanchasecommented, Jul 25, 2022

I’ve created a Nuxt 3 module using the official Nuxt 3 module-builder: https://github.com/nathanchase/dayjs/

It’s on npm currently at: https://www.npmjs.com/package/@nathanchase/nuxt-dayjs-module

It’s barebones, and some of the plugins I use are hardcoded into it. Someone else might be able to make it more modular to use the same dayjs configuration object that the Nuxt 2 dayjs-module uses to specify plugins and other options?

I wasn’t sure the protocol of how to submit this as a PR for this module, since it’s vastly different. You can check the playground for examples of the module working.

Take a look @potato4d, and see what you think.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nuxt: The Intuitive Web Framework
Build your next Vue.js application with confidence using Nuxt. An open source framework under MIT license that makes web development simple and powerful....
Read more >
Nuxt - The Intuitive Vue Framework
Build your next Vue.js application with confidence using Nuxt. An open source framework making web development simple and powerful.
Read more >
Nuxt 3 support : WEB-54200 - YouTrack
To support Nuxt 3 we need: WEB-53890 - index d.ts files in .nuxt folder; WEB-54199 - recognize GlobalComponents Vue 3 interface; remove special...
Read more >
Modules support status · Discussion #751 · nuxt/framework
Currently, we are trying hard to make the bridge module more stable and provide tooling and documentation for module authors in order to...
Read more >
Nuxt (@nuxt_js) / Twitter
One of the core features of Nuxt 3 is the layers system Extend a default Nuxt ... Features Support nuxt v3 rc.11 -...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found