import { DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
import { CustomDateAdapter } from '@shared/CustomDateAdapter';

export function provideCustomDateFormatter() {
    return [
        {
            provide: DateAdapter,
            useClass: CustomDateAdapter,
        },
        {
            provide: MAT_DATE_FORMATS,
            useValue: {
                parse: {
                    dateInput: 'D/M/YY',
                },
                display: {
                    dateInput: 'D/M/YY',
                    monthYearLabel: 'YYYY',
                    dateA11yLabel: 'LL',
                    monthYearA11yLabel: 'YYYY',
                },
            },
        },
    ];
}
