Clever sort
Opened this issue · 0 comments
davorg commented
Add a sort method that handles the Succession to the Crown Act.
Pseudocode:
if ($a->gender ne $b->gender) {
if ($a->gender eq 'm') {
if ($a->born < '28 October 2011') {
return -1;
} else {
return $a->born <=> $b->born;
}
} else {
if ($b->born < '28 October 2011') {
return 1;
} else {
return $a->born <=> $b->born;
}
}
} else {
return $a->born <=> $b->born;
}
Should probably be a method on the person resultset.