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

feat: allow for custom input parsing #40

Merged
merged 4 commits into from
Aug 24, 2022
Merged

Conversation

lewisbirks
Copy link
Collaborator

@lewisbirks lewisbirks commented Aug 24, 2022

Changes

  • Add an additional parameter that allows a user to define a callback that can be used to manipulate the values taken from the date inputs

Use case

A use case for this option would be to determine the prefix of years that are 2 or less digits, by default JS interprets this as 19XX. This may not be the wanted implementation so this new callback option allows the developer to alter the inputs before they are then validated and used to construct a date.

@lewisbirks lewisbirks marked this pull request as ready for review August 24, 2022 14:18
@@ -495,7 +495,7 @@ describe('Date picker', () => {
expect(nextMonthButton.tabIndex).toEqual(0);
});

it('should allow for selection of a day next month', () => {
it('should allow for selection of a day last month', () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noticed that intellij was reporting only 79 tests ran instead of 80, this was the reason why

@lewisbirks lewisbirks force-pushed the feat/custom-input-parsing branch from 73c23e1 to 9e982cc Compare August 24, 2022 15:39
@lewisbirks lewisbirks merged commit 8ae2717 into main Aug 24, 2022
@lewisbirks lewisbirks deleted the feat/custom-input-parsing branch August 24, 2022 15:44
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

Successfully merging this pull request may close these issues.

2 participants