Error: NgbDatePicker with Mask Date
See original GitHub issueI need use A datepicker (NgbDatePicker) with a date mask (angular2-text-mask).
I made the implementation as follows:
<input [textMask]="maskDate" maxlength="10" [(ngModel)]="dataNgDatePicker" type="text" class="form-control m-input" name="FormDate" ngbDatepicker #date="ngbDatepicker" formControlName="FormDate">
<span class="input-group-addon" (click)="date.toggle()">
<i class="la la-calendar glyphicon-th" style="width: 1.2rem; height: 1rem; cursor: pointer;" ></i>
</span>
And the error that appears to me is the following:
VM3588 Component.ngfactory.js:352 ERROR Error: More than one custom value accessor matches form control with unspecified name attribute at _throwError (VM3095 forms.js:2463) at eval (VM3095 forms.js:2544) at Array.forEach (<anonymous>) at selectValueAccessor (VM3095 forms.js:2533) at new FormControlName (VM3095 forms.js:7225) at createClass (VM3039 core.js:12370) at createDirectiveInstance (VM3039 core.js:12207) at createViewNodes (VM3039 core.js:13645) at createEmbeddedView (VM3039 core.js:13523) at callWithDebugContext (VM3039 core.js:14936)
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (1 by maintainers)
Top Results From Across the Web
Error: NgbDatePicker with Mask Date - Bountysource
I need use A datepicker (NgbDatePicker) with a date mask (angular2-text-mask). I made the implementation as follows:
Read more >Create date masking custom directive for NgbDatepicker
Well, you can do it by create a custom masking directive. First of all, create a custom directive. @HostListener will listen to user...
Read more >How to add text-mask in ngx-mydatepicker in angular 2?
I am using ngx-mydatepicker for date field. I need to add text-mask in that code. When i tried to add i got an...
Read more >NgbDatepicker - Angular powered Bootstrap
current is the month that is currently displayed by the datepicker. Type: (date: NgbDate, current?: { year: number; month: number }) => any....
Read more >Can't use mask and datepicker in same input, two ... - Reddit
... my tasks is to put mask in a date input thats use reactive form, ... text-mask and ngx-mask, but I was ended...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe the right way to solve it is to implement a mask function in ngbDatePicker What do you think about it?
I could make it work with a directive, but the mask must be set manually
https://stackblitz.com/edit/angular-zvjxvq
I’m building a mask directive and trying to make it more compatible, if anyone has some issues or ideas, that would be great 😃
RacoonMask