121 Posts
deralex
7 years ago
Topic

Hi,

I use a search form to get a list of events. The user should be able to search for a start date, the list should show all events at this date and later. Even though I've selected match mode "future" and not "future only", the list shows events one after the selected day and later.

I guess it's a time issue because I only pass the date without time.

My idea is to correct the input date before the search is being processed. Seems like changing the value of a field by a beforerender render field doesn't work for searches. $config doesn't contain any values. Is there another field or another way to correct my dates?

Alex

Get a VIP membership
4229 Posts
Kadministrator
7 years ago
1
Level 1

Which field you you use for your search? Calendar field + future should give you what you need.

121 Posts
deralex
7 years ago
0
Level 2

I use a calendar field + future. It doesn't work. Actually it's a time issue: 

I've hidden time because I only want to show and search for dates. If I set the field's default time to let's say 08:00:00, create an event and search, the event isn't shown. If I change the default date to 06:00:00 and search again, the search results are correct.

I had the idea to use two different fields - one for input, the second one for search. But the search uses field aliases, not the storage column. Because you can use a fields alias only once, the idea doesn't work.

Phew... Now what? Can I manipulate time of a search field without changing the input time of the same field?

121 Posts
deralex
7 years ago
0
Level 1

I hope to have it solved....:

Once again my problem: A calendar field only used for dates, not for time. Adding an article with date and after that searching for "future" only shows dates beginning one day after the search day.

To solve that you need a field and a helper field. Important: You have to use the normal field for searching and the helper field for the input form.

If the search is set to "future", you have to set the input (helper) field to a late time, let's say 23:00:00. The search (normal) field must have an earlier time, 00:00:00. 

Both fields must have the same storage settings. Using the "normal" field for searching is important, because it uses the correct alias to process the search. The input helper field only uses storage information for saving, the field alias doesn't matter.

Get a Book for SEBLOD