DateHelper::weekDaysAbbr

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

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

File

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

Class

DateHelper
Defines Gregorian Calendar date values.

Namespace

Drupal\Core\Datetime

Code

public static function weekDaysAbbr($required = FALSE) {
  $weekdays = array(
    t('Sun', array(), array('context' => 'Abbreviated weekday')),
    t('Mon', array(), array('context' => 'Abbreviated weekday')),
    t('Tue', array(), array('context' => 'Abbreviated weekday')),
    t('Wed', array(), array('context' => 'Abbreviated weekday')),
    t('Thu', array(), array('context' => 'Abbreviated weekday')),
    t('Fri', array(), array('context' => 'Abbreviated weekday')),
    t('Sat', 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.