You are here

function date_day_of_week_name in Date 7.3

Same name and namespace in other branches
  1. 5.2 date_api.module \date_day_of_week_name()
  2. 6.2 date_api.module \date_day_of_week_name()
  3. 6 date_api.module \date_day_of_week_name()
  4. 7 date_api/date_api.module \date_day_of_week_name()
  5. 7.2 date_api/date_api.module \date_day_of_week_name()

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

Parameters

mixed $date: (optional) A date, default is current local day. Defaults to NULL.

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.

1 call to date_day_of_week_name()
DateApiTestCase::testDateApi in date_api/tests/DateApiTestCase.test
Test date_format_date().

File

date_api/date_api.module, line 2100
This module will make the date API available to other modules.

Code

function date_day_of_week_name($date = NULL, $abbr = TRUE) {
  if (!is_object($date)) {
    $date = new DateObject($date);
  }
  $dow = date_day_of_week($date);
  $days = $abbr ? date_week_days_abbr() : date_week_days();
  return $days[$dow];
}