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.
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