Dear Sakis,
is it possible to only filter on the year and then in a (nested) second option on the month in a date field?
That would be great.
Elisa
Latest post by sakinho on Thursday, 09 May 2024 15:29 EEST
Dear Sakis,
is it possible to only filter on the year and then in a (nested) second option on the month in a date field?
That would be great.
Elisa
Hi
I think that you can do that but not with the date custom field.
As long as you have 2 custom fields (1 integer for year and 1 list for the months) you can create 2 separate filters for them.
Kind regards,
Sakis Terzis
Founder and Lead Developer
Hi Sakis, can't I just change the date format of created date to Y to filter just by the year?
Hi Elisa
Changing just the format, will not solve your problem. You still need to select a date, if you use the calendar display.
If you just want to filter by year, set the year as a single custom field (either using text custom field or the integer custom field).
This how we do it in our demo page (see Release Year filter).
If this too much and your content is already set, we can prepare a php script that extracts the year from a date field.
You can run that as a cron job and automate the whole process.
Kind regards
Sakis Terzis
Founder and Lead Developer