import { Component } from '@angular/core'; import { NativeInputComponent } from '../../_abstract/native-input.component'; @Component({ selector: 'app-datepicker', templateUrl: './datepicker.component.html', styleUrls: ['./datepicker.component.scss'] }) export class ClrDatepickerComponent extends NativeInputComponent { exposeMetaInTemplate: string[] = ['extraClass', 'placeholder']; ngOnInit() { super.ngOnInit(); // CLarity datepicker expects a string when used reactively const dateObj = this.control.value; const d = dateObj.getDate(); const m = dateObj.getMonth(); const y = dateObj.getFullYear(); this.control.setValue(`${d}/${m + 1}/${y}`); } }