function date_has_time in Date 6.2
Same name and namespace in other branches
- 5.2 date_api.module \date_has_time()
- 5 date.inc \date_has_time()
- 6 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');
8 calls to date_has_time()
- date_combo_validate in date/
date_elements.inc - Validate and update a combo element. Don't try this if there were errors before reaching this point.
- date_field_all_day in date/
date.module - Determine if a from/to date combination qualify as 'All day'.
- date_field_settings_form in date/
date_admin.inc - date_limit_format in ./
date_api.module - Rewrite a format string so it only includes 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 1564 - 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;
}