Criteria entries by date field I want to get only entries with a specific date. I created a date field customDateField. It has the following code:

{% set entries = craft.entries.section('orders').customDateField('2016-04-14') %}


but this not work. How it will look in php?

In element api plugin i was code:

'endpoints' =&gt; [
    'orders.json' =&gt; [
        'elementType' =&gt; 'Entry',
        'criteria' =&gt; [
            'section' =&gt; 'orders',
            'date' =&gt; '&gt;='.craft()-&gt;request-&gt;getPost('date')
        ],
        'transformer' =&gt; function(EntryModel $entry) {
            return [
                'id' =&gt; $entry-&gt;id,
            ];
        },
    ],
]


but it only shows a larger date of entries, need to write 'date-&gt;format("Y-m-d")'
You don't need any extra php code to do that.

The search function probably does the job for you.

{% set entries = craft.entries.section('orders').search('2016-04-14') %}
{% for entry in entries %}
  &lt;h1&gt;{{entry.title}} - {{entry.customDateField}}&lt;/h1&gt;
{% endfor %}