Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 12, 2025

Cherry-picks the calendar date formatting and styling fixes from PR #16618 into the 21.0.x maintenance branch.

Changes

  • DayDigitPipe: Strips non-numeric locale suffixes (e.g., "25日" → "25") for display while preserving full locale strings in programmatic API
  • Calendar styling: Added white-space: nowrap to prevent text wrapping in date/weekday labels
  • Test coverage: Added zh-CN locale test verifying pipe strips non-numeric characters correctly
  • Sample app: Added zh-CN locale option and formatViews binding for demonstration

Technical Detail

The pipe applies only in templates, leaving formattedDate() method output unchanged. This maintains backward compatibility—existing programmatic access returns full locale strings, while UI displays clean numeric values.

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them
Original prompt

Cherry-pick the changes from the merged pull request #16618 (fix(calendar): fix date styles and formatting) into the 21.0.x branch. Ensure all fixes for date styles and formatting in the Calendar component are accurately applied to maintain consistency across versions.

This pull request was created as a result of the following prompt from Copilot chat.

Cherry-pick the changes from the merged pull request #16618 (fix(calendar): fix date styles and formatting) into the 21.0.x branch. Ensure all fixes for date styles and formatting in the Calendar component are accurately applied to maintain consistency across versions.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

desig9stein and others added 3 commits December 12, 2025 12:24
* fix(calendar): ensure text in calendar components does not wrap unexpectedly

* fix(calendar): update days formatting logic to extract day part and add additional locales in sample

* fix(calendar): correct locale codes in sample for Chinese regions

* fix(calendar): add DayDigitPipe to handle non-numeric day characters in locales like zh-CN

- Introduced DayDigitPipe to strip non-numeric characters from localized day strings.
- Updated `IgxDaysViewComponent` to use the new pipe in the day formatting logic.
- Added a test to verify correct formatting for zh-CN locale.

* chore(calendar): update DayDigitPipe paths

- Updated `DayDigitPipe` import paths to use relative paths.

* chore(calendar): mark DayDigitPipe as standalone
Co-authored-by: desig9stein <21260963+desig9stein@users.noreply.github.com>
Copilot AI changed the title [WIP] Cherry-pick date styles and formatting fixes for calendar chore: Cherry-pick PR #16618 (calendar date styles and formatting fixes) to 21.0.x Dec 12, 2025
Copilot AI requested a review from desig9stein December 12, 2025 12:34
@desig9stein desig9stein marked this pull request as ready for review December 12, 2025 12:34
@desig9stein desig9stein removed their request for review December 12, 2025 12:34
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.

2 participants