function date_month_names in Date 7.2
Same name and namespace in other branches
- 5.2 date_api.module \date_month_names()
- 6.2 date_api.module \date_month_names()
- 6 date_api.module \date_month_names()
- 7.3 date_api/date_api.module \date_month_names()
- 7 date_api/date_api.module \date_month_names()
Returns a translated array of month names.
Parameters
bool $required: (optional) If FALSE, the returned array will include a blank value. Defaults to FALSE.
Return value
array An array of month names.
2 calls to date_month_names()
- DateObject::parse in date_api/
date_api.module - Converts a date string into a date object.
- date_repeat_rrule_description in date_repeat/
date_repeat.module - Build a description of an iCal rule.
1 string reference to 'date_month_names'
- date_parts_element in date_api/
date_api_elements.inc - Creates form elements for one or more date parts.
File
- date_api/
date_api.module, line 1215 - This module will make the date API available to other modules.
Code
function date_month_names($required = FALSE) {
$month_names = array();
foreach (date_month_names_untranslated() as $key => $month) {
$month_names[$key] = t($month, array(), array(
'context' => 'Long month name',
));
}
$none = array(
'' => '',
);
return !$required ? $none + $month_names : $month_names;
}