diff --git a/projects/sbb-esta/angular-public/datepicker/src/date-input/date-input.directive.ts b/projects/sbb-esta/angular-public/datepicker/src/date-input/date-input.directive.ts index 02774c6713..aa52dcc148 100644 --- a/projects/sbb-esta/angular-public/datepicker/src/date-input/date-input.directive.ts +++ b/projects/sbb-esta/angular-public/datepicker/src/date-input/date-input.directive.ts @@ -206,8 +206,6 @@ export class DateInputDirective implements ControlValueAccessor, Validator, O /** Whether the last value set on the input was valid. */ private _lastValueValid = false; - private _titleCasePipe = new TitleCasePipe(); - onTouched = () => {}; private _cvaOnChange: (value: any) => void = () => {}; @@ -256,6 +254,7 @@ export class DateInputDirective implements ControlValueAccessor, Validator, O constructor( private _elementRef: ElementRef, + private _titleCasePipe: TitleCasePipe, @Optional() public dateAdapter: DateAdapter, @Optional() @Inject(SBB_DATE_FORMATS) private _dateFormats: DateFormats, @Optional() private _datepicker: DatepickerComponent diff --git a/projects/sbb-esta/angular-public/datepicker/src/datepicker.module.ts b/projects/sbb-esta/angular-public/datepicker/src/datepicker.module.ts index 98a28795d9..eb01f98034 100644 --- a/projects/sbb-esta/angular-public/datepicker/src/datepicker.module.ts +++ b/projects/sbb-esta/angular-public/datepicker/src/datepicker.module.ts @@ -1,7 +1,7 @@ import { A11yModule } from '@angular/cdk/a11y'; import { OverlayModule } from '@angular/cdk/overlay'; import { PortalModule } from '@angular/cdk/portal'; -import { CommonModule } from '@angular/common'; +import { CommonModule, TitleCasePipe } from '@angular/common'; import { NgModule } from '@angular/core'; import { DATE_PIPE_DATE_FORMATS, @@ -59,7 +59,8 @@ import { MonthViewComponent } from './month-view/month-view.component'; providers: [ SBB_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER, { provide: DateAdapter, useClass: NativeDateAdapter }, - { provide: SBB_DATE_FORMATS, useValue: DATE_PIPE_DATE_FORMATS } + { provide: SBB_DATE_FORMATS, useValue: DATE_PIPE_DATE_FORMATS }, + { provide: TitleCasePipe, useClass: TitleCasePipe } ], entryComponents: [DatepickerContentComponent, CalendarHeaderComponent] })