DateHelper::weekDays

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

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

File

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

Class

DateHelper
Defines Gregorian Calendar date values.

Namespace

Drupal\Core\Datetime

Code

public static function weekDays($required = FALSE) {
  $weekdays = array(
    t('Sunday'),
    t('Monday'),
    t('Tuesday'),
    t('Wednesday'),
    t('Thursday'),
    t('Friday'),
    t('Saturday'),
  );
  $none = array('' => '');
  return !$required ? $none + $weekdays : $weekdays;
}
doc_Drupal
2016-10-29 09:00:51
Comments
Leave a Comment

Please login to continue.