Skip to content

fix: #1426 - Mask support for Calendar#19331

Merged
cetincakiroglu merged 5 commits into
masterfrom
inputmask-directive
Jan 28, 2026
Merged

fix: #1426 - Mask support for Calendar#19331
cetincakiroglu merged 5 commits into
masterfrom
inputmask-directive

Conversation

@mehmetcetin01140

Copy link
Copy Markdown
Contributor

fixes: #1426

@github-actions

Copy link
Copy Markdown

Thank you for your contribution! We will review your PR shortly. Please make sure to manually link it to an issue for proper tracking.

@github-actions

Copy link
Copy Markdown

AI Code Review

Changes Suggested

Summary

Adds InputMask support to DatePicker/Calendar component by creating a new directive that can be applied to input elements, including the DatePicker's input field. The PR includes extensive tests for the new directive.

Issue Alignment

The PR addresses the feature request to add InputMask support to Calendar based on dateFormat. However, there's a conceptual mismatch - the issue requests automatic masking based on dateFormat, but the implementation appears to require manual mask configuration through a directive.

Concerns

  • CRITICAL: The PR adds a new InputMaskDirective but doesn't actually integrate it with the DatePicker component beyond adding 'data-p-maskable' attribute
  • The DatePicker template adds 'data-p-maskable' attribute but doesn't actually apply the pInputMask directive
  • No logic exists to automatically generate mask patterns from dateFormat (e.g., 'mm/dd/yy' -> '99/99/99')
  • The implementation requires users to manually configure masks, which doesn't match the issue's request for automatic masking based on dateFormat
  • No documentation or API additions shown for how users would enable this feature in DatePicker
  • The diff shows only test additions to inputmask.spec.ts but the actual directive implementation changes in inputmask.ts are truncated - need to see full implementation
  • Missing integration tests showing DatePicker working with InputMask
  • No explanation of why 'data-p-maskable' attribute is sufficient vs. actually applying the directive

Suggestions

  • The DatePicker should automatically apply InputMask based on its dateFormat property, not require manual directive application
  • Add a boolean input like 'enableMask' to DatePicker to opt-in to masking behavior
  • Create a utility function to convert dateFormat patterns to InputMask patterns (e.g., 'mm/dd/yyyy' -> '99/99/9999')
  • Add integration tests showing DatePicker with masking enabled
  • Document the new feature in DatePicker's API documentation
  • Consider edge cases: localized date formats, time formats, range selection
  • Ensure the mask doesn't interfere with DatePicker's existing keyboard navigation and date parsing

This is an automated review. A maintainer will provide final approval.

@vercel

vercel Bot commented Jan 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
primeng Error Error Jan 27, 2026 9:03am
primeng-5lp7 Ready Ready Preview, Comment Jan 27, 2026 9:03am

@github-actions

Copy link
Copy Markdown

Thanks a lot for your contribution! But, Unit tests failed. You can check the unit tests with the command 'pnpm run test:unit' and commit the changes.

@cetincakiroglu cetincakiroglu merged commit fccc587 into master Jan 28, 2026
4 of 6 checks passed
@cetincakiroglu cetincakiroglu deleted the inputmask-directive branch January 28, 2026 11:43
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.

Mask support for Calendar

2 participants