You are here

public static function DateHelper::weekDaysAbbr2 in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Datetime/DateHelper.php \Drupal\Core\Datetime\DateHelper::weekDaysAbbr2()

Constructs a translated array of 2-letter week day abbreviations.

Parameters

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

Return value

array An array of week day 2 letter abbreviations

File

core/lib/Drupal/Core/Datetime/DateHelper.php, line 212
Contains \Drupal\Core\Datetime\DateHelper.

Class

DateHelper
Defines Gregorian Calendar date values.

Namespace

Drupal\Core\Datetime

Code

public static function weekDaysAbbr2($required = FALSE) {
  $weekdays = array(
    t('Su', array(), array(
      'context' => 'Abbreviated weekday',
    )),
    t('Mo', array(), array(
      'context' => 'Abbreviated weekday',
    )),
    t('Tu', array(), array(
      'context' => 'Abbreviated weekday',
    )),
    t('We', array(), array(
      'context' => 'Abbreviated weekday',
    )),
    t('Th', array(), array(
      'context' => 'Abbreviated weekday',
    )),
    t('Fr', array(), array(
      'context' => 'Abbreviated weekday',
    )),
    t('Sa', array(), array(
      'context' => 'Abbreviated weekday',
    )),
  );
  $none = array(
    '' => '',
  );
  return !$required ? $none + $weekdays : $weekdays;
}