Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,8 @@ export class IgxDaysViewComponent extends IgxCalendarBaseDirective implements Af
*/
public formattedDate(value: Date): string {
if (this.formatViews.day) {
return this.formatterDay.format(value);
const dateParts = this.formatterDay.formatToParts(value);
return dateParts.find(part => part.type === 'day')?.value ?? value.getDate().toString();
Comment on lines +449 to +450
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.
}

return `${value.getDate()}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2516,6 +2516,7 @@
letter-spacing: sizable(var(--ig-body-2-letter-spacing), var(--ig-body-2-letter-spacing), var(--ig-body-1-letter-spacing));
text-transform: sizable(var(--ig-body-2-text-transform), var(--ig-body-2-text-transform), var(--ig-body-1-text-transform));
margin: 0;
white-space: nowrap;
}
}

Expand All @@ -2528,6 +2529,7 @@
letter-spacing: sizable(var(--ig-body-2-letter-spacing), var(--ig-body-2-letter-spacing), var(--ig-body-1-letter-spacing));
text-transform: sizable(var(--ig-body-2-text-transform), var(--ig-body-2-text-transform), var(--ig-body-1-text-transform));
margin: 0;
white-space: nowrap;
}
}
}
11 changes: 11 additions & 0 deletions src/app/calendar/calendar.sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
DateRange,
DateRangeDescriptor,
DateRangeType,
IFormattingViews,
} from 'igniteui-angular';
import {
Properties,
Expand Down Expand Up @@ -62,6 +63,12 @@ export class CalendarSampleComponent implements OnInit {
year: 'numeric',
};

protected formatViews: IFormattingViews = {
day: true,
month: true,
year: true
};
Comment on lines +66 to +70
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.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't add documentation for the demo samples


public panelConfig: PropertyPanelConfig = {
locale: {
label: 'Change Locale',
Expand All @@ -87,6 +94,10 @@ export class CalendarSampleComponent implements OnInit {
{
value: 'ja-JP',
label: 'JP'
},
{
value: 'zh-CN',
label: 'CN'
}
],
defaultValue: 'en-US'
Expand Down
Loading