In my component I pass the following values to the controls. The value I pass are both of type date.
this.form.controls["DepartureDate"].setValue(this.flightChoice.departureDate);
this.form.controls["ReturnDate"].setValue(this.flightChoice.returnDate);
The controls are of type Text because if I use type date the value are not written at all.
<input class="form-control" formControlName="DepartureDate" type="text" id="departureDate" />
<input class="form-control" formControlName="ReturnDate" type="text" id="returnDate" />
Now the result of passing the values is:
a date such this:
2018-06-30T00:00:00+02:00
when I would like a date such:
30-06-2018
What can I do to have this kind of value and also why using the input of type date
will not accept my values?