Skip Navigation

[Resolved] Custom field filter date does not work correctly

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 8 replies, has 2 voices.

Last updated by Minesh 1 year, 2 months ago.

Assisted by: Minesh.

Author
Posts
#2649569
screenshot3.png
screenshot2.png
screenshot1.png

I am trying to: Add a custom filter which is a date field called "completion date". We would like to show the items that have the completion date between 12 months and 36 months ago. See screenshot1.png on how we have the filter.

Link to a page where the issue can be seen: hidden link

I expected to see: See screenshot2.png attached. We're expecting those two items to show since the completion date has been at least 12 months ago.

Instead, I got: No items matching with this filter. However, if changing the "date" to a "string" format and compared to a constant date, it generated the right results, see screenshot3.png

#2649997

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I tried to access the wp-admin but it shows that you setup country wise restriction.

Can you please disable country wise access restriction so that I should be able to access the site.

#2650145

Geoblocking can't be deactivated but I can un-restrict POST for your the country of your current location. hidden link

Which country/ies should I un-restrict?

#2650381

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Thanks but somehow I found a way to access your site.

I would like to clarify here - do you want to display the posts whose completion date falls between past 12 to 36 months from the current date or you want that completion date should fall between past 12 to 26 months or do you want to compare with any specific completion date?

#2650675

Completion date falls between past 12 to 36 months from the current date.

#2650687

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I see you added the query filter for custom field "Status" - What is the use of that field?

Do you want any other query filter or just one query filter where "Completion date falls between past 12 to 36 months from the current date."

#2650999

We need the "Status" custom field as well. So two query filter are needed - "Status" and the "Completion date falls between past 12 to 36 months from the current date"

#2651345

Hello. Any update on this?

#2651431

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: hidden link

I've adjusted the "Query Filter" added to the "Query Filter" section of your view as given under:
=> hidden link

Custom field filter Delete Edit
Select items with field:
Status is a number equal to 2
AND
Completion Date is a number between PAST_MONTH(36), PAST_MONTH(12)

Can you please confirm it works as expected now.

#2651575

Yes, I can confirm it works. So it has to be a "number", got it. thanks.