@@ -11,6 +11,7 @@ import { getCurrentResourceStrings } from '../core/i18n/resources';
11
11
import { KeyboardNavigationService } from './calendar.services' ;
12
12
import { getYearRange , isDateInRanges } from './common/helpers' ;
13
13
import { CalendarDay } from './common/model' ;
14
+ import { IgxIconService } from '../icon/icon.service' ;
14
15
15
16
/** @hidden @internal */
16
17
@Directive ( {
@@ -239,6 +240,25 @@ export class IgxCalendarBaseDirective implements ControlValueAccessor {
239
240
year : false
240
241
} ;
241
242
243
+ private _icons = [
244
+ {
245
+ family : 'default' ,
246
+ name : 'arrow_next' ,
247
+ ref : {
248
+ name : 'keyboard_arrow_right' ,
249
+ family : 'material' ,
250
+ }
251
+ } ,
252
+ {
253
+ family : 'default' ,
254
+ name : 'arrow_prev' ,
255
+ ref : {
256
+ name : 'keyboard_arrow_left' ,
257
+ family : 'material' ,
258
+ }
259
+ }
260
+ ] ;
261
+
242
262
/**
243
263
* An accessor that sets the resource strings.
244
264
* By default it uses EN resources.
@@ -654,10 +674,16 @@ export class IgxCalendarBaseDirective implements ControlValueAccessor {
654
674
@Inject ( LOCALE_ID )
655
675
protected _localeId : string ,
656
676
protected keyboardNavigation ?: KeyboardNavigationService ,
657
- protected cdr ?: ChangeDetectorRef
677
+ protected cdr ?: ChangeDetectorRef ,
678
+ protected iconService ?: IgxIconService ,
658
679
) {
659
680
this . locale = _localeId ;
660
681
this . viewDate = this . viewDate ? this . viewDate : new Date ( ) ;
682
+
683
+ for ( const icon of this . _icons ) {
684
+ this . iconService ?. addIconRef ( icon . name , icon . family , icon . ref ) ;
685
+ }
686
+
661
687
this . initFormatters ( ) ;
662
688
}
663
689
@@ -700,7 +726,7 @@ export class IgxCalendarBaseDirective implements ControlValueAccessor {
700
726
if ( typeof value === 'string' ) {
701
727
value = DateTimeUtil . parseIsoDate ( value ) ;
702
728
}
703
-
729
+
704
730
if ( value === null || value === undefined || ( Array . isArray ( value ) && value . length === 0 ) ) {
705
731
return ;
706
732
}
0 commit comments