1 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

core/includes/date.inc, line 479
Date API functions.

Code

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