bolt/bolt — pull request #496 by doertedev (2013-07-09 09:31:05+00:00)
Title: More php strtotime magic plx...

I run Bolt on MySQL 5.X, got a active_from and active_to column where I whanted to find out WHERE active_from >= this week's monday and <= active_to this week's saturday.

{% setcontent varname = 'contenttype' where { status: 'published',date/(-time)field: "{OPERATOR}{TWIG_VARIABLE}" } %}
Doesnt work as it would be treated as a comparison string, escaped, and pushed into the query.

{% setcontent varname = 'contenttype' where { status: 'published',date/(-time)field: "{OPERATOR}"{TWIG_VARIABLE} } %}
Insufficient syntax leads to hell of a beautiful whoops error page.

{% setcontent varname = 'contenttype' where { status: 'published',date/(-time)field: "{OPERATOR}{RELATIVE_TIMESTAMP_BEFORE_YESTERDAY}" } %}
Wasn't supported.

A BETWEEN feature isnt there right? Did I oversee something? This does work on mysql. On Date fields. We would need a different date() value for datetime/time fields. Also I do not have a running postgres installation to test it with.

Maybe if you guys tell me how to read the config set database type AND the fieldtype I could write a more flexible solution to this problem.