Separate date formats for inputs within same module mat-datepicker

303 views Asked by At

I want to have separate date formats for two different inputs of 2 different components within same module in my angular app I tried creating custom adaptors[ as per the answer https://stackoverflow.com/questions/44452966/angular-2-material-2-datepicker-date-format/53884733] but it applies the format to all inputs. I want two different formats. For one I want to show date while for other only month. I don't seem to find any solution to do that.

What I want is for one input format should be like Sept 2, 2020 while for the other Sept 2020

providers: [
        { provide: MAT_DATE_FORMATS, useValue: DateConstants.DATE_FORMATS },
        { provide: DateAdapter, useClass: AppDateAdapter }]
0

There are 0 answers