Created
February 16, 2018 15:31
-
-
Save codebubb/9ff713bad0110eeb47b30aee57cbd9ab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let pp = this.proposalForm; | |
| let $datefields = $('.date input').datepicker( | |
| { | |
| format: "dd/mm/yyyy" | |
| } | |
| ); | |
| $datefields.on('changeDate', function (e) { | |
| let fcn = $(this).attr('formControlName'); | |
| let index = e; | |
| index = index.currentTarget || null; | |
| index = index.attributes || null; | |
| index = index['data-cpd'] || null; | |
| if (index) { index = index.nodeValue || null; } | |
| if (index) { | |
| let carray = pp.controls.competitor_analysis as FormArray; | |
| let grp = carray.controls[index] as FormGroup; | |
| grp.controls[fcn].setValue(moment(e.date).format("DD/MM/YYYY")) | |
| grp.controls[fcn].markAsDirty(); | |
| } else { | |
| pp.controls[fcn].setValue(moment(e.date).format("DD/MM/YYYY")); | |
| pp.controls[fcn].markAsDirty(); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment