You are here

function event_week_days in Event 5.2

Same name and namespace in other branches
  1. 5 event.module \event_week_days()

Returns week day names and their translated values, corrected for the start of week day settings (mon or sun).

Return value

an associative array containing weekday names

Related topics

5 calls to event_week_days()
event_calendar_day in ./event.module
Displays a daily event calendar.
event_calendar_month in ./event.module
Displays a monthly event calendar.
event_calendar_table in ./event.module
Creates a themed table of events.
event_calendar_week in ./event.module
Displays a weekly event calendar.
event_week_header in ./event.module
Formats the weekday information into table header format

File

./event.module, line 1402

Code

function event_week_days() {
  static $weekdays;
  if (!$weekdays) {
    if (variable_get('date_first_day', 1)) {
      $weekdays = array(
        array(
          'day' => 'Mon',
          't' => t('Mon'),
        ),
        array(
          'day' => 'Tue',
          't' => t('Tue'),
        ),
        array(
          'day' => 'Wed',
          't' => t('Wed'),
        ),
        array(
          'day' => 'Thu',
          't' => t('Thu'),
        ),
        array(
          'day' => 'Fri',
          't' => t('Fri'),
        ),
        array(
          'day' => 'Sat',
          't' => t('Sat'),
        ),
        array(
          'day' => 'Sun',
          't' => t('Sun'),
        ),
      );
    }
    else {
      $weekdays = array(
        array(
          'day' => 'Sun',
          't' => t('Sun'),
        ),
        array(
          'day' => 'Mon',
          't' => t('Mon'),
        ),
        array(
          'day' => 'Tue',
          't' => t('Tue'),
        ),
        array(
          'day' => 'Wed',
          't' => t('Wed'),
        ),
        array(
          'day' => 'Thu',
          't' => t('Thu'),
        ),
        array(
          'day' => 'Fri',
          't' => t('Fri'),
        ),
        array(
          'day' => 'Sat',
          't' => t('Sat'),
        ),
      );
    }
  }
  return $weekdays;
}