Reorders weekdays to match the first day of the week.
array $weekdays: An array of weekdays.
array An array of weekdays reordered to match the first day of the week.
public static function weekDaysOrdered($weekdays) {
$first_day = config('system.date')
->get('first_day');
if ($first_day > 0) {
for ($i = 1; $i <= $first_day; $i++) {
$last = array_shift($weekdays);
array_push($weekdays, $last);
}
}
return $weekdays;
}