You are here

function date_month_names in Date 6

Same name and namespace in other branches
  1. 5.2 date_api.module \date_month_names()
  2. 6.2 date_api.module \date_month_names()
  3. 7.3 date_api/date_api.module \date_month_names()
  4. 7 date_api/date_api.module \date_month_names()
  5. 7.2 date_api/date_api.module \date_month_names()

A translated array of month names

Parameters

$required: If not required, will include a blank value at the beginning of the list.

Return value

an array of month names

6 calls to date_month_names()
date_calc_get_month_from_fullname in date_php4/date_php4_calc.inc
Returns the numeric month from the month name or an abreviation Both August and Aug would return 8.
date_calc_get_month_fullname in date_php4/date_php4_calc.inc
Returns the full month name for the given month.
date_convert_from_custom in ./date_api_elements.inc
Convert a date input in a custom format to a standard date type
date_popup_process_date in date_popup/date_popup.module
Process the date portion of the element.
date_repeat_rrule_description in date_repeat/date_repeat.module
Build a description of an iCal rule.

... See full list

1 string reference to 'date_month_names'
date_parts_element in ./date_api_elements.inc
Create form elements for one or more date parts.

File

./date_api.module, line 89
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_month_names($required = FALSE) {
  static $month_names;
  if (empty($month_names)) {
    $month_names = array();
    foreach (date_month_names_untranslated() as $key => $month) {
      $month_names[$key] = t($month);
    }
  }
  $none = array(
    '' => '',
  );
  return !$required ? $none + $month_names : $month_names;
}