1 date.inc date_month_names_abbr($required = FALSE, $length = 3)

Constructs a translated array of month name abbreviations.

Parameters

bool $required: (optional) If FALSE, the returned array will include a blank value. Defaults to FALSE.

int $length: (optional) The length of the abbreviation. Defaults to 3.

Return value

array: An array of month abbreviations.

File

core/includes/date.inc, line 132
Date API functions.

Code

function date_month_names_abbr($required = FALSE, $length = 3) {
  $month_names = array();
  foreach (date_month_names_untranslated() as $key => $month) {
    if ($length == 3) {
      $month_names[$key] = t(substr($month, 0, $length), array());
    }
    else {
      $month_names[$key] = t(substr($month, 0, $length), array(), array('context' => 'month_abbr'));
    }
  }
  $none = array('' => '');
  return !$required ? $none + $month_names : $month_names;
}