We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have an issue accessing guess with the timezone for Nuxt 3.
guess
config:
export default defineNuxtConfig({ modules: ['dayjs-nuxt'], dayjs: { locales: ['en'], plugins: ['relativeTime', 'utc', 'timezone'], defaultLocale: 'en', defaultTimezone: 'America/New_York', }, });
Reproduction:
https://stackblitz.com/edit/nuxt-starter-xkk6vr?file=app.vue
The text was updated successfully, but these errors were encountered:
thanks for the stackblitz, you might just be calling the composaible wrong, try this:
<template> <div>current timezone: {{ getTimezone() }}</div> </template> <script setup> const dayJs = useDayjs(); const getTimezone = () => { return dayJs.tz.guess(); }; </script>
also it might not be required but if you run into issues you may need to add this dep:
"devDependencies": { "dayjs": "^1.11.12", "dayjs-nuxt": "^2.1.9" }
Sorry, something went wrong.
No branches or pull requests
I have an issue accessing
guess
with the timezone for Nuxt 3.config:
Reproduction:
https://stackblitz.com/edit/nuxt-starter-xkk6vr?file=app.vue
The text was updated successfully, but these errors were encountered: