You are here

function _office_hours_week_days_ordered in Office Hours 7

Reorders weekdays to match the first day of the week. Copied and modified from date_week_days_ordered().

Parameters

array $weekdays: An array of weekdays.

Return value

array An array of weekdays reordered to match the first day of the week.

1 call to _office_hours_week_days_ordered()
office_hours_field_widget_form in includes/office_hours.widget.inc
Implements hook_field_widget_form().

File

./office_hours.module, line 228
Creates a field and widget for inserting working or office hours per day

Code

function _office_hours_week_days_ordered($weekdays, $first_day) {

  // $first_day = variable_get('date_first_day', 0);
  if ($first_day > 0) {
    for ($i = 1; $i <= $first_day; $i++) {
      $last = array_shift($weekdays);
      array_push($weekdays, $last);
    }
  }
  return $weekdays;
}