You are here

public static function DateGranularity::nongranularity in Date 8

Strips out unwanted granularity elements.

Parameters

array $array: An array like ('year', 'month', 'day', 'hour', 'minute', 'second');

Return value

array A reduced set of granularitiy elements.

1 call to DateGranularity::nongranularity()
DateGranularity::limitFormat in date_api/lib/Drupal/date_api/DateGranularity.php
Limits a date format to include only elements from a given granularity array.

File

date_api/lib/Drupal/date_api/DateGranularity.php, line 435
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 nongranularity($array) {
  return array_diff(self::$granularity_parts, (array) $array);
}