angular - How to set custom date in ngx-bootstrap datepicker -
i using ngx-bootstrap datepicker
. want custom date highlighted on load of date-picker
. have date stored in variable , want date selected(highlighted).
component.ts
private dob : string = '2017/07/07';
component.html
<datepicker [activedate]="dob" [showweeks]="false" [startingday]="1" [formcontrol]="form.controls[dob]"></datepicker>
but not working. default today's date selected after setting activedate
. how achieve this? or there other attribute can use instead of activedate
? , there particular format date?
ngmodel
did trick me. instead of setting value activedate
can set ngmodel
. , activedate
accepts date object, need conversion if value string.
i had remove formcontrol
well, since did not work along ngmodel
.
<datepicker [(ngmodel)]="dob" [showweeks]="false" [startingday]="1" (selectiondone)="showdatepicker = false"; ></datepicker>
Comments
Post a Comment