Repository navigation
fix(common): allow DateInput to accept a dot separator - #906
Open
adarshswaminath wants to merge 1 commit into
Open
adarshswaminath wants to merge 1 commit into
adarshswaminath wants to merge 1 commit into
Conversation
Collaborator
🟡 Heimdall Review Status
🟡
|
| Code Owner | Status | Calculation | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ui-systems-eng-team |
🟡
0/1
|
Denominator calculation
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed? Why?
DateInputwithseparator="."dropped normal keystrokes. Typing08was treated as a doubled separator, so the field could not become08.18.2024.The dot is now escaped in the duplicate-separator check.
08..18is still blocked./and-are unchanged. Web and mobileDateInputboth use this shared codeFixes #905
Root cause (required for bugfixes)
IntlDateFormatbuilt the check withnew RegExp(${separator}{2,}). In a regular expression,.means "any character," so any two characters looked like...UI changes
No layout or style change. The only difference is that a dotted date can be typed.
separator=".", a second digit is ignored08182024shows08.18.2024Testing
How has it been tested?
Testing instructions
Unit test:
yarn nx run common:test --testPathPattern=src/dates/__tests__/IntlDateFormat.test.tsStorybook:
yarn nx run storybook:devand open Components → Dates → DateInput.DateInputtoseparator=".".08182024.08.18.2024. A doubled dot such as08..18should still be rejected.Illustrations/Icons Checklist
Required if this PR changes files under
packages/illustrations/**orpackages/icons/**Not applicable.
Change management
type=routine
risk=low
impact=sev5
automerge=false