Как поменять формат даты в JSON запросе

Подскажите пожалуйста, уже третий день сижу ни как не могу допереть, есть фильтр выборки по ТВ pdoRecources
[[!pdoPage?
    &parents=`5`
    &element=`pdoResources`
    &tpl=`posttpl`
    &ajaxMode=`button`
    &tpl=`eventtpl`
    &limit=`10`
    &hideContainers=`1`
    &processTVs=`1`
    &includeTVs=`date,cena,mesto,image`
    &showLog=`1`
    &tvFilters=`date>=[[!start]],date<=[[!end]]`
    ]]
где я беру дату ОТ [[!start]] и ДО [[!end]] и сравниваю их с ТВ полем date, например с 2016-04-04 по 2016-04-05 есть события и 4 и 5 числа, но вот выводиться только то у которого в ТВ 4 число стоит я так подозреваю что это из за того что в ТВ поле дата хранится ещё и с часами и минутами, и 2016-04-05 13:00 больше чем 2016-04-05, от сюда и вопрос как мне мое ТВ поле привести к такому же формату YYYY-MM-DD и будет ли от этого какой либо толк

вот лог:
0.0001130: pdoTools loaded
0.0000269: xPDO query object created
0.0000479: Added TVs filters
0.0004280: Included list of tvs: Date, Mesto, cena, image
0.0002210: leftJoined modTemplateVarResource as TVdate
0.0002680: leftJoined modTemplateVarResource as TVmesto
0.0002320: leftJoined modTemplateVarResource as TVcena
0.0001712: leftJoined modTemplateVarResource as TVimage
0.0003650: Added selection of modResource: SQL_CALC_FOUND_ROWS `id`, `type`, `contentType`, `pagetitle`, `longtitle`, `description`, `alias`, `link_attributes`, `published`, `pub_date`, `unpub_date`, `parent`, `isfolder`, `introtext`, `richtext`, `template`, `menuindex`, `searchable`, `cacheable`, `createdby`, `createdon`, `editedby`, `editedon`, `deleted`, `deletedon`, `deletedby`, `publishedon`, `publishedby`, `menutitle`, `donthit`, `privateweb`, `privatemgr`, `content_dispo`, `hidemenu`, `class_key`, `context_key`, `content_type`, `uri`, `uri_override`, `hide_children_in_tree`, `show_in_tree`, `properties`
0.0000100: Added selection of modTemplateVarResource: IFNULL(`value`, '') AS `tv.Date`
0.0000069: Added selection of modTemplateVarResource: IFNULL(`value`, '') AS `tv.Mesto`
0.0000072: Added selection of modTemplateVarResource: IFNULL(`value`, '') AS `tv.cena`
0.0000062: Added selection of modTemplateVarResource: IFNULL(`value`, '') AS `tv.image`
0.0000670: Replaced TV conditions
0.0006151: Processed additional conditions
0.0010400: Added where condition: 0=`TVdate`.`value` >= '2016-04-04' AND `TVdate`.`value` <= '2016-04-05', modResource.parent:IN(5,7,25,27,4,8,9,10,11,12,13,14,15,16,17,26), modResource.published=1, modResource.deleted=0, modResource.isfolder=0
0.0000570: Replaced TV conditions
0.0001729: Sorted by modResource.publishedon, DESC
0.0000050: Limited to 10, offset 0
0.0004520: SQL prepared "SELECT SQL_CALC_FOUND_ROWS `modResource`.`id`, `modResource`.`type`, `modResource`.`contentType`, `modResource`.`pagetitle`, `modResource`.`longtitle`, `modResource`.`description`, `modResource`.`alias`, `modResource`.`link_attributes`, `modResource`.`published`, `modResource`.`pub_date`, `modResource`.`unpub_date`, `modResource`.`parent`, `modResource`.`isfolder`, `modResource`.`introtext`, `modResource`.`richtext`, `modResource`.`template`, `modResource`.`menuindex`, `modResource`.`searchable`, `modResource`.`cacheable`, `modResource`.`createdby`, `modResource`.`createdon`, `modResource`.`editedby`, `modResource`.`editedon`, `modResource`.`deleted`, `modResource`.`deletedon`, `modResource`.`deletedby`, `modResource`.`publishedon`, `modResource`.`publishedby`, `modResource`.`menutitle`, `modResource`.`donthit`, `modResource`.`privateweb`, `modResource`.`privatemgr`, `modResource`.`content_dispo`, `modResource`.`hidemenu`, `modResource`.`class_key`, `modResource`.`context_key`, `modResource`.`content_type`, `modResource`.`uri`, `modResource`.`uri_override`, `modResource`.`hide_children_in_tree`, `modResource`.`show_in_tree`, `modResource`.`properties`, IFNULL(`TVdate`.`value`, '') AS `tv.Date`, IFNULL(`TVmesto`.`value`, '') AS `tv.Mesto`, IFNULL(`TVcena`.`value`, '') AS `tv.cena`, IFNULL(`TVimage`.`value`, '') AS `tv.image` FROM `modx_site_content` AS `modResource` LEFT JOIN `modx_site_tmplvar_contentvalues` `TVdate` ON `TVdate`.`contentid` = `modResource`.`id` AND `TVdate`.`tmplvarid` = 1 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVmesto` ON `TVmesto`.`contentid` = `modResource`.`id` AND `TVmesto`.`tmplvarid` = 2 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVcena` ON `TVcena`.`contentid` = `modResource`.`id` AND `TVcena`.`tmplvarid` = 3 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVimage` ON `TVimage`.`contentid` = `modResource`.`id` AND `TVimage`.`tmplvarid` = 5 WHERE  ( `TVdate`.`value` >= '2016-04-04' AND `TVdate`.`value` <= '2016-04-05' AND `modResource`.`parent` IN (5,7,25,27,4,8,9,10,11,12,13,14,15,16,17,26) AND `modResource`.`published` = 1 AND `modResource`.`deleted` = 0 AND `modResource`.`isfolder` = 0 )  ORDER BY modResource.publishedon DESC LIMIT 10 "
0.0016448: SQL executed
0.0000808: Total rows: 1
0.0000229: Rows fetched
0.0122311: Prepared and processed TVs
0.0008280: Loaded chunk "eventtpl"
0.0148599: Returning processed chunks
0.0326691: Total time
6 553 600: Memory usage
Александр
29 марта 2016, 20:02
modx.pro
1 063
0

Комментарии: 4

Марат Марабар
29 марта 2016, 23:35
0
[[*data:strtotime:date=`%Y-%m-%e`]]

Вот здесь можно подробней посмотреть.
    Марат Марабар
    29 марта 2016, 23:43
    0
    Только тебе это навряд ли поможет. Это надо уже в БД в таком формате записывать, что бы можно было применить фильтр.

    Добавь в сниппет время, чтобы было так: от 2016-04-04 00:00:00 до 2016-04-05 23:59:59
      Александр
      30 марта 2016, 08:59
      0
      а вот второй вариант помог, тоже думал так сделать, но что то ни как не проверял, сейчас присвоил им часы, пока полет нормальный, спасибо огромное
      Александр
      30 марта 2016, 08:58
      0
      ну в синтаксисе MODX я знаю как форматы переводить, там просто запрос именно JSON но все равно спасибо)
      Авторизуйтесь или зарегистрируйтесь, чтобы оставлять комментарии.
      4