1 date.inc date_week_days_abbr($required = FALSE, $length = 3)

Constructs a translated array of week day abbreviations.

Parameters

bool $required: (optional) If FALSE, the returned array will include a blank value. Defaults to FALSE.

int $length: (optional) The length of the abbreviation. Defaults to 3.

Return value

array: An array of week day abbreviations

File

core/includes/date.inc, line 202
Date API functions.

Code

function date_week_days_abbr($required = FALSE, $length = 3) {
  $weekdays = array();
  switch ($length) {
    case 1:
      $context = 'day_abbr1';
      break;

    case 2:
      $context = 'day_abbr2';
      break;

    default:
      $context = '';
      break;
  }
  foreach (date_week_days_untranslated() as $key => $day) {
    $weekdays[$key] = t(substr($day, 0, $length), array(), array('context' => $context));
  }
  $none = array('' => '');
  return !$required ? $none + $weekdays : $weekdays;
}