Closed
Description
Question
I am having trouble with the date picker component when I use it with reactive form, I am setting formControlName and getting the following error
ERROR TypeError: value.toLocaleDateString is not a function
date.component.html
<igx-date-picker [weekStart]="weekStart" [formControlName]="field.protocolDictId" [id]="field.id"> <label igxLabel>{{field.labelText !== '' ? field.labelText : field.name}}</label> </igx-date-picker>
date.component.ts
const required = this.field.required ? [Validators.required] : null; this.form.addControl(this.field.protocolDictId, new FormControl(new Date(Date.now()), {validators: required, updateOn: 'blur'}));
I have the same code working for other ignite components but having a problem with date-picker component
- igniteui-angular version: 7.0.1
- browser: Chrome, Firefox