-
Notifications
You must be signed in to change notification settings - Fork 158
fix(calendar): fix date styles and formating #16618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(calendar): fix date styles and formating #16618
Conversation
…dd additional locales in sample
There was a problem hiding this 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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
projects/igniteui-angular/calendar/src/calendar/days-view/days-view.component.ts
Outdated
Show resolved
Hide resolved
…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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
projects/igniteui-angular/calendar/src/calendar/days-view/days-view.component.ts
Outdated
Show resolved
Hide resolved
projects/igniteui-angular/calendar/src/calendar/days-view/days-view.component.spec.ts
Show resolved
Hide resolved
projects/igniteui-angular/calendar/src/calendar/day-digit.pipe.ts
Outdated
Show resolved
Hide resolved
projects/igniteui-angular/calendar/src/calendar/day-digit.pipe.ts
Outdated
Show resolved
Hide resolved
- Updated `DayDigitPipe` import paths to use relative paths.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
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)