DateHelper::weekDaysAbbr2

public static DateHelper::weekDaysAbbr2($required = FALSE)

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 209

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;
}
doc_Drupal
2016-10-29 09:00:51
Comments
Leave a Comment

Please login to continue.