function date_has_time in Date 6
Same name and namespace in other branches
- 5.2 date_api.module \date_has_time()
- 5 date.inc \date_has_time()
- 6.2 date_api.module \date_has_time()
- 7.3 date_api/date_api.module \date_has_time()
- 7 date_api/date_api.module \date_has_time()
- 7.2 date_api/date_api.module \date_has_time()
Function to figure out if any time data is to be collected or displayed.
Parameters
granularity: an array like ('year', 'month', 'day', 'hour', 'minute', 'second');
3 calls to date_has_time()
- date_field_settings_form in date/
date_admin.inc - date_limit_format in ./
date_api.module - Rewrite a format string so it only inludes elements from a specified granularity array.
- date_parts_element in ./
date_api_elements.inc - Create form elements for one or more date parts.
File
- ./
date_api.module, line 1127 - This module will make the date API available to other modules. Designed to provide a light but flexible assortment of functions and constants, with more functionality in additional files that are not loaded unless other modules specifically include them.
Code
function date_has_time($granularity) {
if (!is_array($granularity)) {
$granularity = array();
}
return sizeof(array_intersect($granularity, array(
'hour',
'minute',
'second',
))) > 0 ? TRUE : FALSE;
}