All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Low Search combined with Low Events not recognizing my custom field date range - help?

Karen 8 Mar 2015 16:05 question, complete

Hello! I've combed through the docs and other questions, and still can't seem to get my search form with a custom date range to work - any guidance would be HUGELY appreciated!

I'm searching a channel with athletic events, and I have teams set up as categories. My category search of the events works perfectly - but my custom date ranges are ignored.

I'd like to use datepicker for my start and end dates, and datepicker outputs my dates in YYYY-MM-DD format.

My custom low events field is called athletic_event_date. For my search form, I have this (i've removed the category part for simplicity, i know that works):

{exp:low_search:form query="{segment_3}" result_page="athletics/results"}

Go

{/exp:low_search:form}

My results tag looks like this:
{exp:low_search:results channel="athletics_events" query="{segment_3}" orderby="athletic_event_date" sort="desc"}
... rest of output and closing tag...

What am I missing with my ranges? I've tried input type="date" as well, and that makes no difference.

Replies

  1. Karen 8 Mar 2015 16:09

    I want to add that in my template debugging, I do see this on a test search:

    Low Search: Parameters set: channel="athletics_events" query="eyJyZXN1bHRfcGFnZSI6ImF0aGxldGljc1wvcmVzdWx0cyIsInJhbmdlLWZyb206YXRobGV0aWNfZXZlbnRfZGF0ZSI6IjIwMTUtMDMtMDEiLCJyYW5nZS10bzphdGhsZXRpY19ldmVudF9kYXRlIjoiMjAxNS0wMy0wNiJ9" orderby="athletic_event_date" sort="desc" result_page="athletics/results" range-from:athletic_event_date="2015-03-01" range-to:athletic_event_date="2015-03-06" search_mode="all"

    if this is helpful at all. It looks like I should have a date range in place, but all events are returned.

  2. Low 8 Mar 2015 20:06

    Loods like you're trying to use the Ranges filter on the Low Events field. However, the Ranges filter can only target numeric or date fields. The Low Events field is a special field (consisting of two dates, times and all-day option), and can't be targeted with the Ranges filter.

    Instead, read this: http://gotolow.com/addons/low-events/...

    That means you should be able to use the low_events:date_from and low_events:date_to parameters to get the date range you want.

  3. Karen 8 Mar 2015 20:48

    AAAAHHHHhhh - that makes sense- I saw that but misunderstood how to use it in my search form. THANK YOU so much, you made my day!