You are here

function date_repeat_dow_day_options_abbr in Date 8

Same name and namespace in other branches
  1. 7.3 date_repeat/date_repeat.module \date_repeat_dow_day_options_abbr()
  2. 7.2 date_repeat/date_repeat.module \date_repeat_dow_day_options_abbr()

Helper function for FREQ options.

Translated and untranslated arrays of the iCal abbreviated day of week names.

1 call to date_repeat_dow_day_options_abbr()
_date_repeat_rrule_process in date_repeat/date_repeat_form.inc
Generate the repeat setting form.

File

date_repeat/date_repeat.module, line 94
This module creates a form element that allows users to select repeat rules for a date, and reworks the result into an iCal RRULE string that can be stored in the database.

Code

function date_repeat_dow_day_options_abbr($translated = TRUE, $length = 3) {
  $return = array();
  switch ($length) {
    case 1:
      $context = 'day_abbr1';
      break;
    case 2:
      $context = 'day_abbr2';
      break;
    default:
      $context = '';
      break;
  }
  foreach (date_repeat_dow_day_untranslated() as $key => $day) {
    $return[$key] = $translated ? t(substr($day, 0, $length), array(), array(
      'context' => $context,
    )) : substr($day, 0, $length);
  }
  return $return;
}