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

use browser languages preferences to set date value #70

Open
mcshaz opened this issue Dec 19, 2019 · 0 comments
Open

use browser languages preferences to set date value #70

mcshaz opened this issue Dec 19, 2019 · 0 comments

Comments

@mcshaz
Copy link

mcshaz commented Dec 19, 2019

Thank you for the library - great effort & very much appreciated.

I think the few browsers left which do not have a native date type input will be soon gone, so I am not sure how much longer this library will be maintained for. Nevertheless, I have made some changes in a fork which I am happy to put a pull request for if wanted. Heavily tested in IE 11 but NOT old versions of Safari.

The changes are:

  1. update Rollup & Babel versions - I couldn't run a transpile and minify without this step on any of my machines.
  2. use the browser prefered language and only use the lang attribute if the browser languages are not found (using let preferredLocales = window.navigator.languages || [ window.navigator.userLanguage || window.navigator.language ];). This more closely emulates most native date input behaviour.
  3. add a placeholder according to the selected localeText.format e.g. dd/mm/yyyy. This more closely emulates most native date input behaviour.
  4. add a few more cultures (en-AU, en-NZ, en-CA, fr-CA). Default en is en-CA as that is ISO 8601
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

1 participant