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

Datestrings from moment not correctly localized #2448

Closed
raimund-schluessler opened this issue Jan 9, 2024 · 1 comment · Fixed by nextcloud-libraries/nextcloud-moment#781 or #2450
Labels
Milestone

Comments

@raimund-schluessler
Copy link
Member

raimund-schluessler commented Jan 9, 2024

The dates that moment.js parses are not correctly localized anymore. This happens since the migration to vite as a bundler in #2321.

nextcloud/moment should normally load the correct localization on its own, which it did when the app was still build with webpack.

Since we switched to vite, the bundled moment version always uses the english locale. Weirdly, when executing moment in the javascript console, the correct locale is used (but that might be the global moment from server).

@susnux Do you have any idea what could go wrong with vite that the locale does not work anymore?

Example image:
image

@susnux
Copy link

susnux commented Jan 9, 2024

This seems to be related to tree shaking because the locales are not imported for moment thus they are removed. Fixed this on the nextcloud-moment package. See nextcloud-libraries/nextcloud-moment#781

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