Fix Certificate date sorting

This commit is contained in:
John Crisp
2020-04-01 19:27:19 +02:00
parent a0f66eaa21
commit 59ed22d339
2 changed files with 12 additions and 4 deletions

View File

@@ -74,12 +74,17 @@ function gpvar($v) {
# Sort a two multidimensional array by one of it's columns
#
function csort($array, $column, $ascdec=SORT_ASC){
if (sizeof($array) == 0) return $array;
foreach($array as $x) $sortarr[]=$x[$column];
array_multisort($sortarr, $ascdec, $array);
if (sizeof($array) == 0) return $array;
return $array;
// Sort by digital date rather than text date
if ($column == 'issued') $column = "issuedSort";
if ($column == 'expires') $column = 'expiresSort';
foreach($array as $x) $sortarr[]=$x[$column];
array_multisort($sortarr, $ascdec, $array);
return $array;
}