Angular Material Date Picker Range but only choosing year and month

Issue

I’m having troubles to find a way to use mat-date-range-picker with only year and month…
Did you guys have already find a way to do it ? 🙂

I’ve tried to use the same function used in the documentation for the date picker, but i cannot found a way to restart the pop up for the second date….

<mat-datepicker #dp
                  startView="multi-year"
                  (yearSelected)="chosenYearHandler($event)"
                  (monthSelected)="chosenMonthHandler($event, dp)"
                  panelClass="example-month-picker">
</mat-datepicker>

thanks by advance all \o/

Solution

Here’s an example of a month range-picker popup. Just use this to create a popup.
DEMO

Answered By – Naman Jain

Answer Checked By – Terry (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.