Skip Navigation

[Resolved] Front end filtering for dates using textfield – cannot get input values right

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 9 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

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)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Caridad 9 years, 2 months ago.

Assisted by: Minesh.

Author
Posts
#278380

I am trying to allow front end filtering between two date ranges. I can get the filter to work using a datepicker, but I cannot get it to work when using type="textfield". I need the input to be from: dd/mm/yyyy | to: dd/mm/yyyy

The following is between my filter controls:

<div class="allfilters">
  <div class="searchicon"><img src="/wp-content/uploads/2015/01/search1.png" width="30px"></div>
<div class="searchfilter">[wpv-filter-search-box]</div>
	<div class="datefilter">		
	[wpml-string context="wpv-views"]From:[/wpml-string] 
	[wpv-control field="date" url_param="date_min" type="textfield"]

	[wpml-string context="wpv-views"]To:[/wpml-string] 
	[wpv-control field="date" url_param="date_max" type="textfield"]
</div>
<div class="searchbuttonfilter">[wpv-filter-submit name="Search" class="searchbuttonfilter"]</div></div>
<br/>
  <div class="titleone"><h3>Portfolio Strategy Library</h3></div>

The search boxes and submit button all show up, and like I said my query works when using the datepicker. But when I attempt to use the textfield type for date filters, there is no mm/dd/yyyy format that wordpress is recognizing.

Thanks.

#278778

This happens because date custom fields are stored as timestamps and the datepicker is actually sending a timestamp for the filtering, not the formatted date.

Please let me know if you are satisfied with my reply and any other questions you may have.

Regards,
Caridad

The forum ‘Types Community Support’ is closed to new topics and replies.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.