ng2-ui / datetime-picker

Angular2 DateTime Picker
https://ng2-ui.github.io/#/datetime-picker
MIT License
121 stars 62 forks source link

Can't work with FormArray #165

Open ckvoon opened 7 years ago

ckvoon commented 7 years ago

Use in FormArray and this error ... path.split is not a function ... appears.

DEMO!!

It works when there is only one item in FormArray though...but I need to use FormArray so that user can manually add more datepicker fields, so..

Btw, the latest version 0.14.7 seems to have some issue when use with form builder. First time selecting date from datepicker will causes an error Cannot read property 'type' of undefined (ver 0.14.5 works fine though)

allenhwkim commented 7 years ago

@ckvoon thanks for reporting this. I have tried to figure it out, but failed to resolve this issue.

allenhwkim commented 7 years ago

@ng2-ui/datetime-picker anyone?

wqdjl commented 7 years ago

@allenhwkim try to updae datetime-picker.directive.js line 203and 204,change this.parent["name"] for this.parent["path"]

wqdjl commented 7 years ago

@allenhwkim I have repair this ,rewrite datetime-picker.change this.parent["name"] for this.parent["path"] in directive.ts ngOnInit function
image

wqdjl commented 7 years ago

when set default value have some bug , image This can not use format . You can change image

baremaximum commented 7 years ago

I've run into the same problem. Unfortunately wqdjl's solution doesn't work for me.

baremaximum commented 7 years ago

I got wqdjl's solution to work finally. The thing is the changes have to be made in the directive.js file AND in the directive.ts file.