ngx-bootstrap Datepicker Format Value

Source: https://github.com/valor-software/ngx-bootstrap/issues/868

Two way binding
<input type="text" [bsConfig]="bsConfig" [(ngModel)]="this.pilot.dob"
name="bsDatepicker" class="form-control"
#dp="bsDatepicker" bsDatepicker placeholder="MM-dd-yyyy">
on my submit function I change the format of my model value to MM/dd/yyyy ie 01/01/2018
const date = new Date(this.pilot.dob);
this.pilot.dob = moment(date).format('MM/DD/YYYY');

More about moment at https://momentjs.com/docs/#/displaying/format/

Không có nhận xét nào:

Check to be sure that port 22 is enabled before you reload

 https://superuser.com/questions/590600/ufw-is-active-but-not-enabled-why etting  ENABLED=yes  in  /etc/ufw/ufw.conf  did it for me. $ sudo ...