Skip to content

Conversation

@desig9stein
Copy link
Contributor

@desig9stein desig9stein commented Dec 9, 2025

Closes #16557

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

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 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: nowrap CSS 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 IFormattingViews interface 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.

label: 'JP'
},
{
value: 'zh-ZH',
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

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

Corrected locale code from 'zh-ZH' to 'zh-CN'. The correct ISO 639-1 language code for Chinese is 'zh-CN' (Simplified Chinese) or 'zh-TW' (Traditional Chinese), not 'zh-ZH'.

Suggested change
value: 'zh-ZH',
value: 'zh-CN',

Copilot uses AI. Check for mistakes.
@desig9stein desig9stein requested a review from Copilot December 9, 2025 12:17
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

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.

Comment on lines +66 to +70
protected formatViews: IFormattingViews = {
day: true,
month: true,
year: true
};
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

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

The newly added formatViews property lacks documentation explaining its purpose and how it affects calendar behavior. Add a JSDoc comment describing what this configuration controls.

Copilot uses AI. Check for mistakes.
Comment on lines +449 to +450
const dateParts = this.formatterDay.formatToParts(value);
return dateParts.find(part => part.type === 'day')?.value ?? value.getDate().toString();
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

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

The logic now extracts only the 'day' part from the formatted date, which changes the behavior from returning a fully formatted date to returning just the day number. This could be a breaking change if consumers expect the full formatted output. Consider whether this aligns with the intended fix or if a new configuration option is needed.

Suggested change
const dateParts = this.formatterDay.formatToParts(value);
return dateParts.find(part => part.type === 'day')?.value ?? value.getDate().toString();
return this.formatterDay.format(value);

Copilot uses AI. Check for mistakes.
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.

[Calendar] Using date picker with Asian localization (ZH) has bad UI

3 participants