public static function PersianDateHelper::weekDaysAbbr2 in Persian Date for Drupal 8 8
Same name and namespace in other branches
- 8.4 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
Namespace
Drupal\persian_dateCode
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;
}