question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: NgbDatePicker with Mask Date

See original GitHub issue

I 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:open
  • Created 5 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

12reactions
aronrodriguescommented, Jul 3, 2018

I believe the right way to solve it is to implement a mask function in ngbDatePicker What do you think about it?

10reactions
shogogancommented, Mar 6, 2019

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found