Created
October 22, 2014 10:02
-
-
Save keopx/1e24ac464974eb2130d3 to your computer and use it in GitHub Desktop.
Use date filter for node created filter. With it we use date calendar and options.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mymodule_views_data_alter(&$data) { | |
$data['node']['created'] = array( | |
'title' => t('Post date'), // The item it appears as on the UI, | |
'help' => t('The date the content was posted.'), // The help that appears on the UI, | |
'field' => array( | |
'handler' => 'views_handler_field_date', | |
'click sortable' => TRUE, | |
), | |
'sort' => array( | |
'handler' => 'views_handler_sort_date', | |
), | |
'filter' => array( | |
'handler' => 'date_views_filter_handler_simple', // Requires date.module. | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment