function date_nongranularity in Date 7.3
Same name and namespace in other branches
- 5.2 date_api.module \date_nongranularity()
- 5 date.inc \date_nongranularity()
- 6.2 date_api.module \date_nongranularity()
- 6 date_api.module \date_nongranularity()
- 7 date_api/date_api.module \date_nongranularity()
- 7.2 date_api/date_api.module \date_nongranularity()
Strips out unwanted granularity elements.
Parameters
array $granularity: An array like ('year', 'month', 'day', 'hour', 'minute', 'second').
Return value
array A reduced set of granularitiy elements.
3 calls to date_nongranularity()
- date_limit_format in date_api/
date_api.module - Limits a date format to include only elements from a given granularity array.
- date_select_element_process in date_api/
date_api_elements.inc - Flexible date/time drop-down selector.
- date_select_input_date in date_api/
date_api_elements.inc - Helper function for creating a date object out of user input.
File
- date_api/
date_api.module, line 2519 - This module will make the date API available to other modules.
Code
function date_nongranularity(array $granularity) {
$options = array(
'year',
'month',
'day',
'hour',
'minute',
'second',
'timezone',
);
return array_diff($options, (array) $granularity);
}