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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -