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

Do all Date locales ship automatically with sugar library? #692

Open
HNOONa-0 opened this issue Aug 14, 2024 · 1 comment
Open

Do all Date locales ship automatically with sugar library? #692

HNOONa-0 opened this issue Aug 14, 2024 · 1 comment

Comments

@HNOONa-0
Copy link

Only the en locale is present when I downloaded the package. When I tried to setLocale('es') it threw an error. I had to add them manually from this link:https://github.com/andrewplummer/Sugar/tree/master/lib/locales

Is there a way to ship them without doing so manually?

@salao-na-mao-developer
Copy link

@HNOONa-0 you need to to something like that:

import ptSugar from 'node_modules/sugar/locales/pt';

Sugar.Date.addLocale('pt', ptSugar);
Sugar.Date.setLocale('pt');

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