You are here

public static function PersianDateHelper::weekDaysAbbr2 in Persian Date for Drupal 8 8.4

Same name and namespace in other branches
  1. 8 src/PersianDateHelper.php \Drupal\persian_date\PersianDateHelper::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

Overrides DateHelper::weekDaysAbbr2

File

src/PersianDateHelper.php, line 193

Class

PersianDateHelper

Namespace

Drupal\persian_date

Code

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