Closed aciccarello closed 3 years ago
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/dojo/widget-test-docs/DaDub1MQky9X6dTgze4pNSpJdn6k
✅ Preview: https://widget-test-do-git-fork-aciccarello-1563-intl-date-inpu-c7c5af.vercel.app
🔍 Inspect: https://vercel.com/dojo/dojo.widgets/8viT7V7R7e9UZYfdAeNzH572a7Ja
✅ Preview: https://dojowidgets-git-fork-aciccarello-1563-intl-date-input-dojo1.vercel.app
Merging #1712 (fd480a6) into master (8bade73) will decrease coverage by
0.00%
. The diff coverage is96.55%
.
@@ Coverage Diff @@
## master #1712 +/- ##
==========================================
- Coverage 90.05% 90.05% -0.01%
==========================================
Files 94 94
Lines 5050 5077 +27
Branches 1373 1384 +11
==========================================
+ Hits 4548 4572 +24
- Misses 249 251 +2
- Partials 253 254 +1
Impacted Files | Coverage Δ | |
---|---|---|
src/date-input/date-utils.tsx | 97.36% <94.11%> (-2.64%) |
:arrow_down: |
src/date-input/index.tsx | 91.37% <100.00%> (+0.30%) |
:arrow_up: |
src/loading-indicator/index.tsx | 88.46% <0.00%> (-11.54%) |
:arrow_down: |
src/text-input/index.tsx | 92.68% <0.00%> (-0.24%) |
:arrow_down: |
src/time-picker/index.tsx | 81.81% <0.00%> (ø) |
|
src/password-input/index.tsx | 78.57% <0.00%> (ø) |
|
src/chip-typeahead/index.tsx | 89.71% <0.00%> (+0.09%) |
:arrow_up: |
src/select/index.tsx | 86.95% <0.00%> (+0.86%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 8bade73...fd480a6. Read the comment docs.
Type: bug
The following has been addressed in the PR:
.dojorc
theme.variant()
is added to the root domnodetheme.compose
like thisDescription: Adds support for more date formats and the ability to pass a custom date parser. This resolves an issue with the date handling outside of a few select locales and adds support for several common date formats (as defined by
Intl.DateTimeFormat().format()
). For other locales or for more flexible date parsing (such as to support multiple formats at once), a custom date formatter/parser combo can be passed.For locales where
Intl.DateTimeFormat().format()
produces something that is not supported, selecting a date from the calendar was resulting in an invalid date warning. This was because the Date value is formatted as a string usingDateTimeFormat
and later parsed. The fix was adding a check to the date-to-string formatter that avoids outputting un-parseable strings and defaults to ISO strings.Resolves #1563