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

Changing Locale not work on dayjs #7099

Closed
1 task done
Djaangoo opened this issue Nov 10, 2023 · 5 comments
Closed
1 task done

Changing Locale not work on dayjs #7099

Djaangoo opened this issue Nov 10, 2023 · 5 comments

Comments

@Djaangoo
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.0.6

Environment

Chrome

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Go to the link
Try changing locale by clicking top buttons (like in demo)

What is expected?

Changing locale like in demo work for calendars etc.

What is actually happening?

Language of the components changed but calendar still have English names of the week

@cc-hearts
Copy link
Contributor

hello, for calendar locale switching, you need to import locale resources in advance, e.g. import 'dayjs/locale/en'.

Here's my latest modification of the demo , hope it helps!

@Djaangoo
Copy link
Author

@cc-hearts okey, thanks but it's not work in Nuxt 3
any ideas how to fix that? 😅

@cc-hearts
Copy link
Contributor

I'll look into it.🤔

@cc-hearts
Copy link
Contributor

Under nuxt, you need to import the packages under dayjs in advance for the desired switching language, here is a demo, hope it helps!

@Djaangoo
Copy link
Author

Cool, thanks a lot!

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

2 participants