1 date.inc date_week_days_ordered($weekdays)

Reorders weekdays to match the first day of the week.

Parameters

array $weekdays: An array of weekdays.

Return value

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

File

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

Code

function date_week_days_ordered($weekdays) {
  $first_day = config_get('system.date', 'first_day');
  if ($first_day > 0) {
    for ($i = 1; $i <= $first_day; $i++) {
      $last = array_shift($weekdays);
      array_push($weekdays, $last);
    }
  }
  return $weekdays;
}