File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
projects/igniteui-angular/calendar/src/calendar/days-view Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -446,7 +446,8 @@ export class IgxDaysViewComponent extends IgxCalendarBaseDirective implements Af
446446 */
447447 public formattedDate ( value : Date ) : string {
448448 if ( this . formatViews . day ) {
449- return this . formatterDay . format ( value ) ;
449+ const dateParts = this . formatterDay . formatToParts ( value ) ;
450+ return dateParts . find ( part => part . type === 'day' ) ?. value ?? value . getDate ( ) . toString ( ) ;
450451 }
451452
452453 return `${ value . getDate ( ) } ` ;
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import {
1919 DateRange ,
2020 DateRangeDescriptor ,
2121 DateRangeType ,
22+ IFormattingViews ,
2223} from 'igniteui-angular' ;
2324import {
2425 Properties ,
@@ -62,6 +63,12 @@ export class CalendarSampleComponent implements OnInit {
6263 year : 'numeric' ,
6364 } ;
6465
66+ protected formatViews : IFormattingViews = {
67+ day : true ,
68+ month : true ,
69+ year : true
70+ } ;
71+
6572 public panelConfig : PropertyPanelConfig = {
6673 locale : {
6774 label : 'Change Locale' ,
@@ -87,6 +94,10 @@ export class CalendarSampleComponent implements OnInit {
8794 {
8895 value : 'ja-JP' ,
8996 label : 'JP'
97+ } ,
98+ {
99+ value : 'zh-ZH' ,
100+ label : 'ZH'
90101 }
91102 ] ,
92103 defaultValue : 'en-US'
You can’t perform that action at this time.
0 commit comments