function date_nongranularity in Date 6
Same name and namespace in other branches
- 5.2 date_api.module \date_nongranularity()
- 5 date.inc \date_nongranularity()
- 6.2 date_api.module \date_nongranularity()
- 7.3 date_api/date_api.module \date_nongranularity()
- 7 date_api/date_api.module \date_nongranularity()
- 7.2 date_api/date_api.module \date_nongranularity()
An difference array of granularity elements that are NOT in the granularity array. Used by functions that strip unwanted granularity elements out of formats and values.
Parameters
$granularity: an array like ('year', 'month', 'day', 'hour', 'minute', 'second');
3 calls to date_nongranularity()
- date_limit_format in ./
date_api.module - Rewrite a format string so it only inludes elements from a specified granularity array.
- date_limit_value in ./
date_api.module - Recalculate a date so it only includes elements from a granularity array. Helps prevent errors when unwanted values round up and ensures that unwanted date part values don't get stored in the database.
- date_select_process in ./
date_api_elements.inc - Flexible date/time drop-down selector.
File
- ./
date_api.module, line 1303 - This module will make the date API available to other modules. Designed to provide a light but flexible assortment of functions and constants, with more functionality in additional files that are not loaded unless other modules specifically include them.
Code
function date_nongranularity($granularity) {
return array_diff(array(
'year',
'month',
'day',
'hour',
'minute',
'second',
'timezone',
), (array) $granularity);
}