Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Day JS in Nuxt guessing timezone using tz.guess() not a function #454

Open
sts-ryan-holton opened this issue Feb 22, 2023 · 0 comments
Open

Comments

@sts-ryan-holton
Copy link

I'm using the @nuxtjs/dayjs module v1.4.1 in my Nuxt 2 project. I need to guess the user's timezone and set a datetime in their timezone. When I try to run my JS, I get an error telling me it's not a function, what am I missing?

// Day JS config
dayjs: {
  locales: ['en'],
  defaultLocale: 'en',
  plugins: [
    'utc',
    'timezone',
    'relativeTime',
    'advancedFormat',
    'localizedFormat',
    'customParseFormat'
  ]
},

Called like in a function:

this.$dayjs().tz.guess()

returns error:

this.$dayjs(...).tz.guess is not a function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant