I've had this problem using the latest version and few months old version of 5.x-2.x dev. When I use a filter of either Event Begin or Even End Date and "now" everything works fine, but if I put in a date YYYY-MM-DD HH:MM:SS the view silently fails.

I did some digging and did views_build_view and listed out the query and notice 'now' gets converted to YYYY-MM-DD HH:MM:SS, where as when i put in "YYYY-MM-DD HH:MM:SS" it gets converted to a unix timestamp.

I dug through the module code and didn't come up with anything obvious.

A little help?

Here's what i get when i use "now":
Array ( [query] => SELECT node.nid, rand() AS random_sort, event.event_start AS event_event_start, node.title AS node_title, node.changed AS node_changed FROM {node} node LEFT JOIN {event} event ON node.nid = event.nid WHERE (event.event_end > DATE_ADD('2008-08-01 22:47', INTERVAL 0 SECOND)) ORDER BY random_sort ASC, event_event_start ASC [countquery] => SELECT count(node.nid) FROM {node} node LEFT JOIN {event} event ON node.nid = event.nid WHERE (event.event_end > DATE_ADD('2008-08-01 22:47', INTERVAL 0 SECOND)) [items] => Array ( [0] => stdClass ... AND THEN ALL THE QUERIED NODES

And when i put the full date in I get *just* this:
Array ( [query] => SELECT node.nid, rand() AS random_sort, event.event_start AS event_event_start, node.title AS node_title, node.changed AS node_changed FROM {node} node LEFT JOIN {event} event ON node.nid = event.nid WHERE (event.event_end > DATE_ADD('1217606400', INTERVAL 0 SECOND)) ORDER BY random_sort ASC, event_event_start ASC [countquery] => SELECT count(node.nid) FROM {node} node LEFT JOIN {event} event ON node.nid = event.nid WHERE (event.event_end > DATE_ADD('1217606400', INTERVAL 0 SECOND)) [summary] => [level] => [args] => Array ( [0] => event.event_end [1] => > [2] => 1217606400 [3] => ) [items] => Array ( ) )

Comments

Ken Hawkins’s picture

Status: Active » Needs review

Well, I was inspired by http://drupal.org/node/288826 And got it working. Found where I could get the date to come out as properly formatted non-unix time.

Line 197 read: $value = $filter['value'] == 'now' ? "***CURRENT_DATETIME***" : strtotime($filter['value']);

Changed to: $value = $filter['value'] == 'now' ? "***CURRENT_DATETIME***" : date("Y-m-d h:i", strtotime($filter['value']));

Ken Hawkins’s picture

Actually, I don't know what i was thinking, should just be this:
Line 197: $value = $filter['value'] == 'now' ? "***CURRENT_DATETIME***" : ($filter['value']);