DateHelper::weekDaysAbbr1

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

Constructs a translated array of 1-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 1 letter abbreviations

File

core/lib/Drupal/Core/Datetime/DateHelper.php, line 233

Class

DateHelper
Defines Gregorian Calendar date values.

Namespace

Drupal\Core\Datetime

Code

public static function weekDaysAbbr1($required = FALSE) {
  $weekdays = array(
    t('S', array(), array('context' => 'Abbreviated 1 letter weekday Sunday')),
    t('M', array(), array('context' => 'Abbreviated 1 letter weekday Monday')),
    t('T', array(), array('context' => 'Abbreviated 1 letter weekday Tuesday')),
    t('W', array(), array('context' => 'Abbreviated 1 letter weekday Wednesday')),
    t('T', array(), array('context' => 'Abbreviated 1 letter weekday Thursday')),
    t('F', array(), array('context' => 'Abbreviated 1 letter weekday Friday')),
    t('S', array(), array('context' => 'Abbreviated 1 letter weekday Saturday')),
  );
  $none = array('' => '');
  return !$required ? $none + $weekdays : $weekdays;
}
doc_Drupal
2016-10-29 09:00:51
Comments
Leave a Comment

Please login to continue.