Judging by the waiting list on some of the pull requests (and also by the limited number of browsers still in use which do not have native date input elements) I suspect this is a dead repo.
As such I made some changes over time rather than creating multiple issues and independent branches/pull requests for each issue. This pull request is therefore more to bring to the attention of anyone wishing to use this repo that changes in this pull request may be worth having a look.
Changes:
Scores more cultures and languages. Some code changes to keep file size small
lazy loading so only a tiny code base is loaded if date input is natively supported
uses browser culture preferences when selecting date culture - as an example, if the browser culture is set as en-uk, the date will be displayed in DMY, even if the page has a lang="en" attribute.
a textValue property is added which is the native value property of the text input
valueAsDate handles being assigned null (perfectly valid) or invalid dates (.getTime() is NaN)
typing or deleting a text date directly in the input element adjusts the datepicker and the value/valueAsDate properties accordingly (although at present only dates between 1000 & 2999 A.D.)
tabbing to the next field closes the datepicker
bug fixed with the up/down arrows whereby they would move the date 1 day only within the current month/year and then cycle back to the same month
updated the devDependencies to latest versions, including moving from rollup-plugin-babel-minify (deprecated/no longer supported) to rollup-plugin-terser.
moved the support matrix to IE11 only - this is based on the fact that I am not sure the extra code base for earlier versions is worth it given current usage stats, but you could always run the build yourself with the appropriate rollup options babel.preset.target. Similarly it is not tested in Safari.
There is a gest-age.html, a gestational age calculator which is why I needed the updated date picker. It is worth playing with this for testing purposes, and also seeing how to implement lazy loading with a tiny and nodep code base.
Judging by the waiting list on some of the pull requests (and also by the limited number of browsers still in use which do not have native date input elements) I suspect this is a dead repo.
As such I made some changes over time rather than creating multiple issues and independent branches/pull requests for each issue. This pull request is therefore more to bring to the attention of anyone wishing to use this repo that changes in this pull request may be worth having a look.
Changes:
en-uk
, the date will be displayed in DMY, even if the page has alang="en"
attribute.textValue
property is added which is the native value property of the text input.getTime() is NaN
)value
/valueAsDate
properties accordingly (although at present only dates between 1000 & 2999 A.D.)rollup-plugin-babel-minify
(deprecated/no longer supported) torollup-plugin-terser
.rollup options babel.preset.target
. Similarly it is not tested in Safari.There is a gest-age.html, a gestational age calculator which is why I needed the updated date picker. It is worth playing with this for testing purposes, and also seeing how to implement lazy loading with a tiny and nodep code base.