Skip Navigation

[Resolved] Filter search by date range does not work

This support ticket is created 6 years, 7 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.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by Robert Mueller 6 years, 7 months ago.

Assisted by: Nigel.

Author
Posts
#919655

I am trying to: filter wp-types objects by date range. The code in the view definition is:

<div class="form-group">
	<label>[wpml-string context="wpv-views"]Von: [/wpml-string]</label>
	[wpv-control-postmeta field="wpcf-datum-fertigstellung" url_param="wpv-wpcf-datum-fertigstellung_min"]
</div>
<div class="form-group">
	<label>[wpml-string context="wpv-views"] Bis: [/wpml-string]</label>
	[wpv-control-postmeta field="wpcf-datum-fertigstellung" url_param="wpv-wpcf-datum-fertigstellung_max"]
</div>

It worked for former versions of views, it seems that <wpv-control-postmeta> is new (introduced by the current views version) and does not work properly for date range filters?

Link to a page where the issue can be seen:
hidden link
I expected to see: A list of objects where the date value is within the range (these objects definitely do exist, see full list of objects shown when custom search page is loaded first)

Instead, I got: No items found

#919838

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screen Shot 2018-07-02 at 12.25.18.png
Screen Shot 2018-07-02 at 12.25.32.png

Hi Robert

I just tested this on a local site and it worked as expected.

Check that the Query Filter associated with your date filter control is comparing the field as a number between the dates.

If you cannot see the Query Filter section, use the screen options tab at the top of the page to expose it.

(See screenshots.)

#920714

Thank you very much. Your hint solved the problem.
Robert