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

igDatePicker calendar falls back to default regional settings when 'en-US' is passed #1842

Closed
damyanpetev opened this issue Nov 19, 2018 · 1 comment

Comments

@damyanpetev
Copy link
Member

damyanpetev commented Nov 19, 2018

Description

The regional option on the igDatePicker applies regional settings to the underlying jQuery UI date picker as well. However, when 'en-US' the control sets the $.ig.util.regional instead, which is the default regional and can be any valid one (in this case Japanese). This can cause the calendar to display in a different regional from the set option.

This is caused by changes for #1358

Steps to reproduce

  1. Run the attached sample
  2. Select en-US regional
  3. Open the date picker

Result

Calendar displayed in Japanese

Expected result

Calendar should display with en settings.

Attachments

CAS-30288-Sample5.zip

@ViktorSlavov
Copy link
Contributor

@damyanpetev
This is occurring because of the explicit check for this.options.regional === 'en-US' (link).
However, the check is necessary for the fix for #1358, as the default value for regional is en-US (inherited from widget component) (link).
We can approach the fix for this a couple of ways - we can either override the inherited value for regional in the baseEditor class (fixing the issue for all editors, but not for other controls) OR we can change the default value of regional for the widget class to defaults (fixing the issue for all controls, but overriding existing behavior). The latter seems to be a more correct approach (as there is always a 'defaults' property set in the regional object) (link)

kdinev added a commit that referenced this issue Dec 4, 2018
#1842 - set regional defaults to "defaults" instead of "en-US" - 17.2
kdinev added a commit that referenced this issue Dec 4, 2018
#1842 - set regional defaults to "defaults" instead of "en-US"
kdinev added a commit that referenced this issue Dec 4, 2018
#1842 - set regional defaults to "defaults" instead of "en-US" - 18.1
kdinev added a commit that referenced this issue Dec 4, 2018
#1842 - set regional defaults to "defaults" instead of "en-US" - 18.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants