public static function DateHelper::dayOfWeekName

Returns translated name of the day of week for a given date.

Parameters

mixed $date: (optional) A date object, timestamp, or a date string. Defaults to NULL, whcih means use the current date.

string $abbr: (optional) Whether to return the abbreviated name for that day. Defaults to TRUE.

Return value

string The name of the day in the week for that date.

File

drupal/core/modules/datetime/lib/Drupal/datetime/DateHelper.php, line 517
Contains \Drupal\datetime\DateHelper.

Class

DateHelper
Defines Gregorian Calendar date values.

Namespace

Drupal\datetime

Code

public static function dayOfWeekName($date = NULL, $abbr = TRUE) {
  if (!$date instanceof DrupalDateTime) {
    $date = new DrupalDateTime($date);
  }
  $dow = self::dayOfWeek($date);
  $days = $abbr ? self::weekDaysAbbr() : self::weekDays();
  return $days[$dow];
}