Skip to content

Instantly share code, notes, and snippets.

@alexdrupal
Last active December 23, 2015 08:19
Show Gist options
  • Save alexdrupal/6606429 to your computer and use it in GitHub Desktop.
Save alexdrupal/6606429 to your computer and use it in GitHub Desktop.
Views Contextual filter values to display a list of users with today's birthday
$results = db_query("SELECT entity_id FROM field_data_field_birthday WHERE DATE_FORMAT(field_birthday_value,'%m-%d') = DATE_FORMAT(NOW(),'%m-%d') AND entity_type = 'user'");
$ids = array();
foreach ($results as $result) {
$ids[] = $result->entity_id;
}
return implode(',',$ids);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment