I use ng-bootstrap datepicker, but when I save the form, the date is saved as.
date: {
day: 01,
month: 12,
year: 16
}
I was hoping that I could save him as something more than "2016-11-23T00:39:31.768Z"
Here is my implementation:
<div class="input-group">
<button class="input-group-btn" (click)="d.toggle()" >
<md-icon svgSrc="assets/images/calendar-plus.svg" style="cursor: pointer;"></md-icon>
</button>
<input class="form-control" placeholder="dd-mm-yyyy" name="dp" formControlName="due_date" navigation="arrows" ngbDatepicker #d="ngbDatepicker">
</div>
And form.component:
constructor( private fb: FormBuilder ) {
this.form = this.fb.group({
due_date: [''],
});
}
source
share