You are here

function date_week_days_ordered in Date 5.2

Same name and namespace in other branches
  1. 6.2 date_api.module \date_week_days_ordered()
  2. 6 date_api.module \date_week_days_ordered()
  3. 7.3 date_api/date_api.module \date_week_days_ordered()
  4. 7 date_api/date_api.module \date_week_days_ordered()
  5. 7.2 date_api/date_api.module \date_week_days_ordered()

Order weekdays Correct weekdays array so first day in array matches the first day of the week. Use to create things like calendar headers.

Parameters

array $weekdays:

Return value

array

1 call to date_week_days_ordered()
DateAPI::testDateAPI in tests/date_api.test

File

./date_api.module, line 233
This module will make the date API available to other modules. Designed to provide a light but flexible assortment of functions and constants, with more functionality in additional files that are not loaded unless other modules specifically include them.

Code

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