You are here

function date_month_names_abbr in Date 6

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

A translated array of month name abbreviations

Parameters

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

Return value

an array of month abbreviations

1 call to date_month_names_abbr()
date_convert_from_custom in ./date_api_elements.inc
Convert a date input in a custom format to a standard date type
1 string reference to 'date_month_names_abbr'
date_parts_element in ./date_api_elements.inc
Create form elements for one or more date parts.

File

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