I have a content type with a date field (myFieldDate) whose values are timestamps. (I'm collecting only day, month, and year.)
I have a custom form where I have a select list to select month and year.
I need to use the EntityFieldQuery
class to get all the nodes where the date field contains the month and the year I specified.
$query = new EntityFieldQuery();
$query
->entityCondition('entity_type', 'node')
->entityCondition('bundle', 'horas')
->propertyCondition('status', NODE_PUBLISHED)
->fieldCondition('field_day', 'value', $myFieldDate, '=');
If the select list contains '2015-05'
, for example, the query should return all nodes where myFieldDate contains a date for that month and year.