Skip to content

refactor(date-time-input): New parser and date parts logic#2075

Open
rkaraivanov wants to merge 6 commits intomasterfrom
rkaraivanov/refactor-date-time-input
Open

refactor(date-time-input): New parser and date parts logic#2075
rkaraivanov wants to merge 6 commits intomasterfrom
rkaraivanov/refactor-date-time-input

Conversation

@rkaraivanov
Copy link
Member

  • 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

* 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
@rkaraivanov rkaraivanov requested a review from Copilot January 30, 2026 14:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 DateTimeMaskParser class 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 DateTimeUtil to 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigation: DatePicker/DateTimeInput don't add filled part while writing a value

1 participant