I think Angular Material is your go to, there are many options to make it work you're way.
This is just an sample of how you can do it. Everything comes from the documentation: https://material.angular.io/components/datepicker/overview
<mat-form-field>
<input matInput [matDatepicker]="picker" placeholder="Choose a date" [formControl]="date" >
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker
startView="multi-year"
[startAt]="startDate"
(yearSelected)="chosenYearHandler($event)"
(monthSelected)="chosenMonthHandler($event, dp)">
</mat-datepicker>
</mat-form-field>
and the functions
date = new FormControl(new Date());
chosenYearHandler(Year) {
this.date.setValue(Year);
}
chosenMonthHandler(Month) {
this.date.setValue(Month);
}
I recommend you read the documentation again and rethink the options you can do with the datepicker. Good luck!
DateAdapter. See more at material.angular.io/components/datepicker/overview sectionChoosing a date implementation and date format settings- Jacopo Sciampi