You are here

function date_has_time in Date 7

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

10 calls to date_has_time()
date_field_all_day in ./date.module
Determine if a from/to date combination qualify as 'All day'.
date_limit_format in date_api/date_api.module
Rewrite a format string so it only includes elements from a specified granularity array.
date_parts_element in date_api/date_api_elements.inc
Create form elements for one or more date parts.
date_popup_element_value_callback in date_popup/date_popup.module
Element value callback for date_popup element.
date_popup_input_date in date_popup/date_popup.module
Helper function for extracting a date value out of user input.

... See full list

File

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