I'm currently switching from Moment.js to date-fns in my Angular app, but I'm facing an impediment.
I found as well an adapter made by angular @angular/material-date-fns-adapter and I added this in my material module:
{
provide: DateAdapter,
useClass: DateFnsAdapter,
deps: [MAT_DATE_LOCALE],
},
{ provide: MAT_DATE_FORMATS, useValue: DateHelpers.MatDateFormat }
and I'm getting the following error which I can't manage to solve:
Error: node_modules/@angular/material-date-fns-adapter/adapter/date-fns-adapter.d.ts:5:45 - error TS2314: Generic type 'DateAdapter<D>' requires 1 type argument(s).
5 export declare class DateFnsAdapter extends DateAdapter<Date, Locale> {
Is anyone who faced this issue or knows how to fix it?