You are here

function date_granularity_sorted in Date 7.3

Same name and namespace in other branches
  1. 6.2 date_api.module \date_granularity_sorted()
  2. 7 date_api/date_api.module \date_granularity_sorted()
  3. 7.2 date_api/date_api.module \date_granularity_sorted()

Sorts a granularity array.

Parameters

array $granularity: An array of date parts.

1 call to date_granularity_sorted()
date_granularity_precision in date_api/date_api.module
Give a granularity array, return the highest precision.

File

date_api/date_api.module, line 1606
This module will make the date API available to other modules.

Code

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