refactor(date-time-input): New parser and date parts logic#2075
Open
rkaraivanov wants to merge 6 commits intomasterfrom
Open
refactor(date-time-input): New parser and date parts logic#2075rkaraivanov wants to merge 6 commits intomasterfrom
rkaraivanov wants to merge 6 commits intomasterfrom
Conversation
* Refactored date-time-input to use a new datetime mask parser * Created date-part components to handle individual date/time parts * Updated validators and tests accordingly * Removed old date-util files * Code cleanup and minor improvements in related components * Updated i18n controller for better localization support * Fixed an issue with style parts in the date-time-input component Closes #2072
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the date-time-input component by replacing the previous date utility classes with a new parser architecture and dedicated date-part components.
Changes:
- Introduced a new
DateTimeMaskParserclass for handling date/time format parsing and validation - Created individual date-part classes to encapsulate validation and spin logic for each date/time component
- Migrated validation and formatting logic from the old
DateTimeUtilto the new architecture - Updated i18n controller for better localization support and centralized date formatting
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/index.ts |
Updated exports to reference new date-part module |
src/components/mask-input/mask-input.ts |
Refactored to use new _isEmptyMask getter |
src/components/mask-input/mask-input-base.ts |
Added _isEmptyMask getter for cleaner empty mask checks |
src/components/date-time-input/validators.ts |
Updated validators to use new helper functions and public methods |
src/components/date-time-input/datetime-mask-parser.ts |
New parser class for date/time mask handling |
src/components/date-time-input/datetime-mask-parser.spec.ts |
Tests for the new datetime mask parser |
src/components/date-time-input/date-util.ts |
Removed old date utility class |
src/components/date-time-input/date-util.spec.ts |
Removed old date utility tests |
src/components/date-time-input/date-time-input.ts |
Refactored to use new parser and date-part architecture |
src/components/date-time-input/date-time-input.spec.ts |
Updated tests to work with new architecture and added i18n tests |
src/components/date-time-input/date-part.ts |
New date-part classes for encapsulating validation and spin logic |
src/components/date-time-input/date-part.spec.ts |
Tests for date-part classes |
src/components/date-range-picker/date-range-picker.utils.spec.ts |
Updated to use new i18n formatting functions |
src/components/date-range-picker/date-range-picker.ts |
Updated to use new i18n formatting functions |
src/components/date-picker/date-picker.ts |
Updated to use new i18n formatting functions |
src/components/common/i18n/i18n-controller.ts |
Added date formatting utilities and fixed resource change callback binding |
src/components/calendar/helpers.ts |
Enhanced type safety for isValidDate and added date comparison helpers |
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.
Closes #2072