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

Localization using plugin as modal #45

Open
zaidas1m opened this issue Dec 11, 2024 · 2 comments
Open

Localization using plugin as modal #45

zaidas1m opened this issue Dec 11, 2024 · 2 comments

Comments

@zaidas1m
Copy link

zaidas1m commented Dec 11, 2024

I am using the @googlproxer/ion-range-calendar package in my Angular project, and I need to configure the calendar to display the names of months and days in a specific locale (e.g., German). However, I couldn't find clear documentation on how to achieve this.

Angular Version: 17.3.0
@googlproxer/ion-range-calendar: 18.0.1

Expected Behavior:
The calendar should:

  1. Display month names (e.g., Januar, Februar, etc.) in the desired locale.
  2. Display day labels (e.g., Mo, Di, Mi, etc.) in the desired locale.
  3. Start the week on Monday as per the locale.

I have set in LOCALE_ID in providers array:
Captura de pantalla 2024-12-11 a las 13 11 47

Also, I set calendarMonths:
Captura de pantalla 2024-12-11 a las 13 12 47

But result is still months in english:
Captura de pantalla 2024-12-11 a las 13 13 39

Questions:
How can I configure the calendar to use a specific locale for months and days?
Is there a specific locale property I need to define, and if so, what structure does it require?
Are there any built-in locales, or do I need to manually provide the localized strings?

Any guidance or examples would be highly appreciated. Thank you!

@zaidas1m zaidas1m changed the title Localization Localization using plugin as modal Dec 11, 2024
@Googlproxer
Copy link
Collaborator

We use date-fns to handle formatting of date values.
You can change the date-fns locale globally as defined here: https://date-fns.org/v4.1.0/docs/setDefaultOptions

@zaidas1m
Copy link
Author

Thanks, it worked.

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