what i am trying to achieve is to set empty date field. By default it fills field with current date.
My template file
<ng-datepicker [(ngModel)]="empty_date" [options]="options1"></ng-datepicker>
My .ts file
public options1: DatepickerOptions;
ngOnInit() {
this.options1 = {
minYear: 2018,
maxYear: 2100,
displayFormat: 'DD.MM.YYYY',
barTitleFormat: 'MMMM YYYY',
firstCalendarDay: 1
};
this.empty_date = {formatted: ''};
}
i also tried with this.empty_date = "";
, this.empty_date = null;
and displayValue: ''
inside options1.
How can i set initial field value as empty?