Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

267
Views
use Angular Material MomentDateAdapter solo en el nivel de componente

Tengo varios componentes en mi aplicación que usaban mat-datepicker en ellos. pero en uno de ellos, quiero usar MomentDateAdapter . El problema es que cuando lo proporciono en un componente, afecta a todos los demás componentes.

 @Component({ selector: 'my-moment-mat-date-picker', templateUrl: './my-moment-mat-date-picker.component.html', styleUrls: ['./my-moment-mat-date-picker.component.scss'], providers: [ // `MomentDateAdapter` can be automatically provided by importing `MomentDateModule` in your // application's root module. We provide it at the component level here, due to limitations of // our example generation script. { provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS], }, { provide: MAT_DATE_FORMATS, useValue: MY_FORMATS }, ], })

y

 import { MAT_MOMENT_DATE_ADAPTER_OPTIONS, MomentDateAdapter, } from '@angular/material-moment-adapter'; import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE, } from '@angular/material/core'; import * as _moment from 'moment'; // tslint:disable-next-line:no-duplicate-imports import { default as _rollupMoment } from 'moment'; const moment = _rollupMoment || _moment; export const MY_FORMATS = { parse: { dateInput: 'LL', }, display: { dateInput: 'LL', monthYearLabel: 'MMM YYYY', dateA11yLabel: 'LL', monthYearA11yLabel: 'MMMM YYYY', }, };
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

El problema fue que import { MatMomentDateModule } from "@angular/material-moment-adapter" en el módulo de mi componente y luego importé este módulo en el módulo compartido.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!