I am uisng ngb date picker. this is my html
<div class="input-group">
<input class="form-control ngbfield" placeholder="yyyy-mm-dd" required
name="checkdate" [readonly]="true" #vl="ngModel"
[(ngModel)]="profile.checkDate" ngbDatepicker #d1="ngbDatepicker"
required>
<div class="input-group-append">
<button class="btn btn-outline-secondary fa fa-calendar" (click)="d1.toggle()" type="button"></button>
</div>
</div>
Currently, the date picker is working well. I checked it using console log. This is my console log
this is my component file
export class MyProfileComponent implements OnInit {
profile: any = {};
@ViewChild(NgForm) profileform: NgForm;
dtOptions: DataTables.Settings = {};
constructor(private calendar: NgbCalendar) { }
ngOnInit() {
this.selectToday();
}
selectToday() {
this.profile.checkDate = this.calendar.getToday();
}
addScheduleCheckin(a) {
console.log(a);
alert(a);
}
}
But I need to get this date as below checkDate:"2021-05-22"
Have any option to do it in this library.