twig - Setcontent / Selecting on dates -


bolt's docs say can use several ‘shortcuts’ selecting records dates in past or future. , "internally, bolt uses strtotime() funtion this, refer manual page details."

so, trying use date_modify() in setcontent = 'something' {} doesn't work.

here tried do:

{% setcontent = 'showtimes'    { datefield: '>tomorrow && <"tomorrow"|day_modify("+1 day")' }  %}  

and can use variable in condition instead "tomorrow"|day_modify("+1 day")?

could tell me please, did go wrong?

unfortunately want not straightforward.

you cannot modify shortcuts way. "shortcut" tomorrow working inside setcontent, part try modify twig filter "tomorrow"|day_modify("+1 day") not work.

you try following, i'm not sure if works:

{% setcontent = 'showtimes' { datefield: '>tomorrow && <+2 days'   %} 

otherwise need prepare date format before call setcontent, , append parameter string:

{% set day_after_tomorrow = "+2 days"|date("y-m-d") %} {% setcontent = 'showtimes' { datefield: '>tomorrow && <' ~ day_after_tomorrow %} 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -