Skip Navigation

[Resolved] Filtering by custom date & time field not working with UNSIGNED that is equal to

This support ticket is created 5 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by Luo Yang 5 years, 4 months ago.

Assisted by: Luo Yang.

Author
Posts
#1293757
Screenshot_2.jpg
Screenshot_1.jpg

I need to filter programs in a view by date. The date is a Custom Field that is of the Date & Time type, as I am collecting start and end date and times.

In the view I want the end user to select the date and see all programs on the selected day. I get no results when using 'equal to' but get results when I use 'greater than or equal'.

When I change the Custom Field to only Date, the filtering work fine. It seems to me that it is related to the formatting of the time being different between the date picker and the Date & Time format.

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

I expected to see: All programs on that date

Instead, I got: Sorry, no programs found

#1294323

Hello,

Thanks for the details, I can log into your website, will update here if there is any found.

#1294339

That is expected result, the custom date field created with Types plugin stores value in timestamp format, for example:
2019-07-18
2019-07-18 12:46

They are different timestamp values, so your filters won't work, and returns result: no programs found

You can try one of below options:
1) As you mentioned above, use Date & Time format in your custom date field.
2) Setup two date-pickers, pass two URL parameters to view, and filter the result with "between" range filter,
https://toolset.com/documentation/user-guides/date-filters/#filtering-between-dates