public static function DateHelper::monthNamesAbbr

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.

Return value

array An array of month abbreviations.

File

drupal/core/modules/datetime/lib/Drupal/datetime/DateHelper.php, line 117
Contains \Drupal\datetime\DateHelper.

Class

DateHelper
Defines Gregorian Calendar date values.

Namespace

Drupal\datetime

Code

public static function monthNamesAbbr($required = FALSE) {

  // Force the key to use the correct month value, rather than
  // starting with zero.
  $monthnames = array(
    1 => t('Jan'),
    2 => t('Feb'),
    3 => t('Mar'),
    4 => t('Apr'),
    5 => t('May'),
    6 => t('Jun'),
    7 => t('Jul'),
    8 => t('Aug'),
    9 => t('Sep'),
    10 => t('Oct'),
    11 => t('Nov'),
    12 => t('Dec'),
  );
  $none = array(
    '' => '',
  );
  return !$required ? $none + $monthnames : $monthnames;
}