Skip to content

igx-date-picker doesn't seems to be working with reactive form #8919

Closed
@umermalik129

Description

@umermalik129

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions