function date_week_days_ordered in Date 7.2
Same name and namespace in other branches
- 5.2 date_api.module \date_week_days_ordered()
- 6.2 date_api.module \date_week_days_ordered()
- 6 date_api.module \date_week_days_ordered()
- 7.3 date_api/date_api.module \date_week_days_ordered()
- 7 date_api/date_api.module \date_week_days_ordered()
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.
1 call to date_week_days_ordered()
- DateApiTestCase::testDateApi in date_api/
tests/ DateApiTestCase.test - Test date_format_date().
File
- date_api/
date_api.module, line 1341 - This module will make the date API available to other modules.
Code
function date_week_days_ordered(array $weekdays) {
$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;
}