2

I am trying to pull entries that match a date criteria. Any ideas why this is not working?

{% set entries = craft.entries({
section: 'leads',
lastAssigned: '("now"|date_modify("-3 days"))'
}) %}

I get the following error.

Fatal error: Call to a member function getTimestamp() on a non-object in .../craft/app/helpers/DbHelper.php on line 597
1

I believe it's the quotes that is throwing it off. Try this:

{% set entries = craft.entries({
section: 'leads',
lastAssigned: now | date_modify("-3 days")
}) %}
1

Jameal put me on the right track here. What I actually needed was to select entries where lastAssigned date was more than 3 days old. I accomplished this by.

{% set entries = craft.entries({
    section: 'leads',
    lastAssigned:' <' ~ now |date_modify("-3 days")
}) %}

Posting my solution here because I think this will be helpful to someone in the future.

Not the answer you're looking for? Browse other questions tagged or ask your own question.