getItems date filter query

161 views
Skip to first unread message

T_Gu3

unread,
Jul 9, 2012, 12:20:29 PM7/9/12
to podi...@googlegroups.com
Hi Guys,

Is it possible to filter the output of getItems by the value of a date field found in an app item? For example can something like the following work:

$items = $api->item->getItems(APP_ID, array(6119271 => '2012-07-13',  'sort_by' => 'created_on'));

If something like this is possible are you also able to check if the date field value matches a date range?

Thanks

Thomas

Christian Holm

unread,
Jul 9, 2012, 4:47:54 PM7/9/12
to podi...@googlegroups.com
Hi

You can indeed use intervals in the format 'FROM-TO', f.ex. '2012-07-13-2012-07-14' for the 13th to the 14th. You can also leave out either the from or to, like '-2012-07-13' or '2012-07-13-'. 

It is a bit hard to read with the from/to divider being the same as the date-parts divider (-), but it works :)

Christian

T_Gu3

unread,
Jul 10, 2012, 4:36:37 AM7/10/12
to podi...@googlegroups.com
Christian

You have helped me to get the date filter working, here's how I did it:

$items = $api->item->getItems(APP_ID, array(6119271 => '2012-07-09-2012-07-15', 'sort_by' => 'created_on'));

Thanks for your help

Thomas
Reply all
Reply to author
Forward
0 new messages