You are here

function date_has_time in Date 5.2

Same name and namespace in other branches
  1. 5 date.inc \date_has_time()
  2. 6.2 date_api.module \date_has_time()
  3. 6 date_api.module \date_has_time()
  4. 7.3 date_api/date_api.module \date_has_time()
  5. 7 date_api/date_api.module \date_has_time()
  6. 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');

5 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 includes elements from a specified granularity array.
date_parts_element in ./date_api_elements.inc
Create form elements for one or more date parts.
theme_date_all_day in date/date.theme
Adjust from/to date format to account for 'all day'.
theme_date_display_combination in date/date.theme
Theme from/to date combination in the view.

File

./date_api.module, line 1298
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;
}