You are here

function date_day_of_week_name in Date 7

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.3 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: a date, default is current local day

string $abbr: Whether to return the abbreviated name for that day

Return value

the name of the day in the week for that date

1 call to date_day_of_week_name()
DateAPITestCase::testDateAPI in tests/date_api.test

File

date_api/date_api.module, line 1413
This module will make the date API available to other modules. Designed to provide a light but flexible assortment of functions and constants, with more functionality in additional files that are not loaded unless other modules specifically include them.

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];
}