You are here

public static function DateGranularity::hasTime in Date 8

Determines if the granularity contains a time portion.

Parameters

array $array: An array of allowed date parts, all others will be removed.

Return value

bool TRUE if the granularity contains a time portion, FALSE otherwise.

8 calls to DateGranularity::hasTime()
DateGranularity::limitFormat in date_api/lib/Drupal/date_api/DateGranularity.php
Limits a date format to include only elements from a given granularity array.
DateGranularity::limitFormat in date_api/lib/Drupal/date_api/DateGranularity.php
Limits a date format to include only elements from a given granularity array.
date_all_day_date_field_widget_settings_form_alter in date_all_day/date_all_day.module
Implements hook_date_field_widget_settings_form_alter().
date_all_day_field in date_all_day/date_all_day.module
Determine if a Start/End date combination qualify as 'All day'.
date_combo_validate in ./date_elements.inc
Validate and update a combo element. Don't try this if there were errors before reaching this point.

... See full list

File

date_api/lib/Drupal/date_api/DateGranularity.php, line 448
Definition of DateGranularity.

Class

DateGranularity
This class manages granularity. It can set granularity, get it from an array, get it from a format string, see if the array has any time or date elements, set and unset various granularity parts, create a nongranularity array of the granularity parts…

Namespace

Drupal\date_api

Code

public static function hasTime($array) {
  return (bool) count(array_intersect($array, self::$time_parts));
}