public static function DateGranularity::precision in Date 8
Give a granularity array, return the highest precision.
Parameters
array $array: An array of date parts.
Return value
string The most precise element in a granularity array.
3 calls to DateGranularity::precision()
- DateGranularity::format in date_api/
lib/ Drupal/ date_api/ DateGranularity.php - Constructs a valid DATETIME format string, limited to a certain granularity.
- date_all_day_field in date_all_day/
date_all_day.module - Determine if a Start/End date combination qualify as 'All day'.
- theme_date_display_combination in ./
date.theme - Returns HTML for a date element formatted as a Start/End combination.
File
- date_api/
lib/ Drupal/ date_api/ DateGranularity.php, line 241 - 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_apiCode
public static function precision($array) {
$input = self::sorted($array);
return array_pop($input);
}