public static function PersianDateHelper::weekDaysAbbr1 in Persian Date for Drupal 8 8.4
Same name and namespace in other branches
- 8 src/PersianDateHelper.php \Drupal\persian_date\PersianDateHelper::weekDaysAbbr1()
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
Overrides DateHelper::weekDaysAbbr1
File
- src/
PersianDateHelper.php, line 217
Class
Namespace
Drupal\persian_dateCode
public static function weekDaysAbbr1($required = FALSE) {
$weekdays = [
t('S', [], [
'context' => 'Abbreviated 1 letter weekday Sunday',
]),
t('M', [], [
'context' => 'Abbreviated 1 letter weekday Monday',
]),
t('T', [], [
'context' => 'Abbreviated 1 letter weekday Tuesday',
]),
t('W', [], [
'context' => 'Abbreviated 1 letter weekday Wednesday',
]),
t('T', [], [
'context' => 'Abbreviated 1 letter weekday Thursday',
]),
t('F', [], [
'context' => 'Abbreviated 1 letter weekday Friday',
]),
t('S', [], [
'context' => 'Abbreviated 1 letter weekday Saturday',
]),
];
$none = [
'' => '',
];
return !$required ? $none + $weekdays : $weekdays;
}