When a project have a date, then it is finished.
When a project has no date, it ist ‘work in progress’
On a page I want to show all projects sorted by their status:
$groups = $projects->children()->visible()->group(function($project) {
if(!$project->date()) return 'In progress';
return $project->date('Y');
});
that gives me
[2014] => Pages Object
(
[0] => projectA
)
[2009] => Pages Object
(
[0] => projectB
)
[In progress] => Pages Object
(
[0] => projectC
[1] => projectD
)
How can I sort this, so that ‘In progress’ is first and then the years?