mirror of
https://github.com/voc/streaming-website
synced 2024-11-15 00:47:14 +00:00
sort days in the schedule
This commit is contained in:
parent
2bfe55c99c
commit
6250f381d6
1 changed files with 12 additions and 1 deletions
|
@ -85,8 +85,19 @@ class Schedule extends ModelBase
|
||||||
$day['end'] = $dayend;
|
$day['end'] = $dayend;
|
||||||
}
|
}
|
||||||
|
|
||||||
$dayidx = 0;
|
|
||||||
|
$daysSorted = [];
|
||||||
foreach($schedule->day as $day)
|
foreach($schedule->day as $day)
|
||||||
|
{
|
||||||
|
$daysSorted[] = $day;
|
||||||
|
}
|
||||||
|
|
||||||
|
usort($daysSorted, function($a, $b) {
|
||||||
|
return (int)$a['start'] - (int)$b['start'];
|
||||||
|
});
|
||||||
|
|
||||||
|
$dayidx = 0;
|
||||||
|
foreach($daysSorted as $day)
|
||||||
{
|
{
|
||||||
$dayidx++;
|
$dayidx++;
|
||||||
$daystart = (int)$day['start'];
|
$daystart = (int)$day['start'];
|
||||||
|
|
Loading…
Reference in a new issue