Skip to content
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();
}

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
};

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-ZH',
label: 'ZH'
}
],
defaultValue: 'en-US'
Expand Down
Loading