You are here

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

Same name and namespace in other branches
  1. 8 src/PersianDateHelper.php \Drupal\persian_date\PersianDateHelper::weekDays()

Returns a translated array of week names.

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 names

Overrides DateHelper::weekDays

1 call to PersianDateHelper::weekDays()
PersianDateHelper::dayOfWeekName in src/PersianDateHelper.php
Returns translated name of the day of week for a given date.

File

src/PersianDateHelper.php, line 145

Class

PersianDateHelper

Namespace

Drupal\persian_date

Code

public static function weekDays($required = FALSE) {
  $weekdays = [
    t('Sunday'),
    t('Monday'),
    t('Tuesday'),
    t('Wednesday'),
    t('Thursday'),
    t('Friday'),
    t('Saturday'),
  ];
  $none = [
    '' => '',
  ];
  return !$required ? $none + $weekdays : $weekdays;
}