You are here

function date_week_days in Date 7

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

A translated array of week days

Parameters

$required: If not required, will include a blank value at the beginning of the array.

Return value

an array of week day names

2 calls to date_week_days()
date_day_of_week_name in date_api/date_api.module
Returns translated name of the day of week for a given date.
date_popup_process_date in date_popup/date_popup.module
Process the date portion of the element.

File

date_api/date_api.module, line 821
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_week_days($required = FALSE, $refresh = TRUE) {
  $weekdays = array();
  foreach (date_week_days_untranslated() as $key => $day) {
    $weekdays[$key] = t($day, array(), array(
      'context' => 'day_name',
    ));
  }
  $none = array(
    '' => '',
  );
  return !$required ? $none + $weekdays : $weekdays;
}