Filter Low search by Date / Custom fiel ?
Hello,
we are working with low_search and would like to add to our Code:
{exp:low_search:results query="{freebie_2}" limit="10" paginate="both" show_expired="yes"}
something like: "where event_date > date-30 days}
I didn#t find any working solution, maybe you can help me ?
greetings
Frank
Replies
Low 15 Nov 2013 08:50
What is the field type for the event_date field?
Frank Oehrlein 15 Nov 2013 08:55
It is a field in expression_channel_data . it is the date with that i try to filter Events from the last 30 days to the future.
Sorry my English is not the best
Low 15 Nov 2013 09:01
Is it a native Date field? If so, you can use the Range filter.
Frank Oehrlein 15 Nov 2013 09:10
It is field_id_7 and the date is in seconds (1383260340) did you mean that ?
Low 15 Nov 2013 09:15
Don't look at the database. Look at your EE Control Panel. You added the field to a channel field group and gave it a name (event_date?). Use that with the Range filter:
Frank Oehrlein 15 Nov 2013 09:29
Yes that goes in the right direction
range-from:event_date="{current_time}-'2592000'"
But he wont let mit go back 30 days ?!
Frank Oehrlein 15 Nov 2013 09:31
got it !
Damn i am stupid.
THANKS A LOT !!!!
Frank Oehrlein 15 Nov 2013 09:39
Nearly but not complete correct.
Maybe you know how to go back 30 days ? That doesn't work ?!
range-from:event_date="{current_time format="%U" -25920000}"
Low 15 Nov 2013 09:40
Try this: range-from:event_date="-30 days"
Frank Oehrlein 15 Nov 2013 09:42
PERFECT
That's it, thanks