I have done something similar for an entertainment app that allows users to filter events on a specific month. My data is in Google Sheets and includes a date/time column. I created a new column in the Google Sheet with the formula =TEXT(D2,“mmmm yyyy”) where D2 is the cell reference for the date/time column.
The original date column shows: 3/5/2022 6:45:00
The new column shows: March 2022.
Then to build a filter for my users, I used a choice component that shows a drop-down selection of all month/years to choose from.
My method isn’t as automatic as @Uzo because as I add multiple rows to the sheet, I have to copy down that formula into the new rows.
My approach to this, which I’ve used over and over (and over) again:
Math column to extract the year: Year(Date)
Math column to extract the month index number: Month(Date)-1
Single Value column to fetch the Month name (see below)
Template column to stitch the month and year back together: {month} {year}
The above results in something like “Mar 2022” or “March 2022”.
For step 3 (the single value column), I have a list of month names in a lookup table, and the single value takes the month index “from start” to get the correct month name.
4 columns might seem a little overkill for something like this, but it’s solid and it works 100% of the time. You could achieve the same thing with a single column using the Format Date plugin for example, but that definitely won’t work 100% of the time.