fix(calendar): fix date styles and formating#16618
Conversation
…dd additional locales in sample
There was a problem hiding this comment.
Pull request overview
This PR fixes date styling and formatting issues in the calendar component. The changes address text wrapping problems in calendar headers and improve date formatting logic to extract only the day portion when formatting is enabled.
Key changes:
- Added
white-space: nowrapCSS to prevent text wrapping in calendar headers - Updated day formatting logic to extract only the day part from formatted dates
- Added Chinese locale option and
IFormattingViewsinterface usage in the sample application
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/app/calendar/calendar.sample.ts | Added formatViews configuration and Chinese locale option to demo the calendar formatting features |
| projects/igniteui-angular/core/src/core/styles/components/calendar/_calendar-theme.scss | Added white-space: nowrap to prevent text wrapping in calendar month and year headers |
| projects/igniteui-angular/calendar/src/calendar/days-view/days-view.component.ts | Changed date formatting to extract only the day part using formatToParts instead of returning the full formatted string |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…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.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Updated `DayDigitPipe` import paths to use relative paths.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* 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
…mponent Co-authored-by: desig9stein <21260963+desig9stein@users.noreply.github.com>
Co-authored-by: desig9stein <21260963+desig9stein@users.noreply.github.com>
…es) to 21.0.x (#16647) * Initial plan * fix(calendar): fix date styles and formating (#16618) * 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 * Fix import path for DayDigitPipe in test file to use relative path Co-authored-by: desig9stein <21260963+desig9stein@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Marin Popov <desig9stein@users.noreply.github.com> Co-authored-by: desig9stein <21260963+desig9stein@users.noreply.github.com>
…1.x (#16646) * Initial plan * Cherry-pick PR #16618: fix date styles and formatting for Calendar component Co-authored-by: desig9stein <21260963+desig9stein@users.noreply.github.com> * Complete cherry-pick of PR #16618 with successful builds and reviews Co-authored-by: desig9stein <21260963+desig9stein@users.noreply.github.com> * Revert karma-jasmine-spec-tags addition from package.json Co-authored-by: desig9stein <21260963+desig9stein@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: desig9stein <21260963+desig9stein@users.noreply.github.com> Co-authored-by: Marin Popov <desig9stein@users.noreply.github.com>
Closes #16557
Additional information (check all that apply):
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)