How To Display Year and Month in dropdown filter?

Hi Team, I am showing data through doghnut chart for which i am giving option to users to select year and month from dropdown so chart can show data depends on year and month selected. How can i achieve to show year and month in dropdown and also how can i filter data based on selected year and month which i am displaying on chart.
1 answers

Do you need a small subset of years to choose from or a complete list of years?