I have a view of a content type named "calendar_events" which has a date field. I only want to show events which are in the future, so I have a filter set up with the operator as "greater than or equal to" and the "date default" set to "now". Granularity is set to "minute".
However yesterday I had an event which had a start time of 10.30am and was still showing up on the view in the evening indicating that the time wasn't being taken into account.
So today out of interest I set the time filter manually to be 11.00am and the event is gone as expected.
Comparing the SQL query, there seems to be a discrepancy between setting a fixed value:
WHERE (( (node.status = '1') AND (node.type IN ('calendar_event')) AND (DATE_FORMAT(ADDTIME(field_data_field_cal_event_date.field_cal_event_date_value, SEC_TO_TIME(3600)), '%Y-%m-%d\T%H:%i') >= '2011-06-04T10:00') ))
and a relative value (now):
WHERE (( (node.status = '1') AND (node.type IN ('calendar_event')) AND (DATE_FORMAT(ADDTIME(field_data_field_cal_event_date.field_cal_event_date_value, SEC_TO_TIME(3600)), '%Y-%m-%d\T%H:%i') >= '2011-06-04 21:49') ))
I'm presuming the missing "T" is causing the filter to break?
Comments
Comment #1
Anonymous (not verified) commentedThe "T" seems to be replaced by a space in line 73 of date_views_filter_handler_simple.inc
Comment #2
hamoo commentedI experienced the same issue. It seems to be fixed in the current dev version (by re-replacing the space by "T" on the returned value).
Comment #3
karens commentedIf it's fixed in the current dev version it needs to be marked as fixed.
Comment #4
Mon Reveur commentedIt's fixed in the current dev version. However, you can't create or edit any filter based on date that uses popup. If you change it to "text", then it does a long dump which is difficult to decipher.
The other problem now is that timezone handling works differently. My date field is defined with a granularity of seconds and uses the site's timezone. The query doesn't convert the existing data to the site's timezone.
Comment #5
karens commentedDon't pile unrelated issues in here. Each issue needs its own report.
Comment #6
Mon Reveur commentedI know you're on a rampage... but the issues are related. This issue is specific to the fact that "now" is missing the "T"... but it's only a symptom of the real issue which is that date filters are not working. There is a major change in the dev version in the handling of timezones. So even though there is a "T" in the string, "now" is actually 5 hours off because the values stored in the database are converted to UTC. So, actually, this issue isn't resolved!