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

Custom lang doesn't work with monts #7

Closed
agustinglez opened this issue Aug 17, 2022 · 4 comments
Closed

Custom lang doesn't work with monts #7

agustinglez opened this issue Aug 17, 2022 · 4 comments

Comments

@agustinglez
Copy link

Hi!

If you set your custom "language", months return "undefined" with this config in Docs

new VanillaCalendar('#calendar', { settings: { lang: 'define', }, locale: { months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], }, });

image

@uvarov-frontend
Copy link
Owner

Hi, if you set your settings.lang to 'define', you need to specify your locale not only for months but also for weeks.

new VanillaCalendar('#calendar', {
  settings: {
    lang: 'define',
  },
  locale: {
    months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
    weekday: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
  },
});

@agustinglez
Copy link
Author

Yes, I did it, but doesn't work

image

@uvarov-frontend
Copy link
Owner

Your "locale" must be outside of "settings"

@agustinglez
Copy link
Author

You're right. My bad, sorry. I didn't sleep well.

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