1.20.x date.inc date_granularity_sorted($granularity)

Sorts a granularity array.

Parameters

array $granularity: An array of date parts.

Return value

array: The list of date parts sorted from largest to smallest granularity.

File

includes/date.inc, line 478
Date API functions and constants.

Code

function date_granularity_sorted($granularity) {
  return array_intersect(array(
    'year',
    'month',
    'day',
    'hour',
    'minute',
    'second',
  ), $granularity);
}