Skip to content

Commit

Permalink
correctly sort tracks for json output
Browse files Browse the repository at this point in the history
  • Loading branch information
aloxe committed Nov 15, 2024
1 parent 09906e0 commit 71986c2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion public/datavelo/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
}
closedir($dir);

asort($tracks);
sort($tracks);
$known_countries = array();
$known_country_year = array();
echo "<table class=\"countries\"><tr>";
Expand Down
2 changes: 1 addition & 1 deletion public/datavelo/tracklist.json.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}
closedir($dir);
$trackliste = [];
asort($tracks);
sort($tracks);
$i = 0;
foreach ($tracks as $key => $val) {
$date = substr($val, 0, 10);
Expand Down
1 change: 1 addition & 0 deletions public/datavelo/tracks.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
}
closedir($dir);

sort($tracks);
echo json_encode($tracks); //, JSON_PRETTY_PRINT);

?>
4 changes: 2 additions & 2 deletions public/datavelo/velotraces.json.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
}
}
closedir($dir);
// asort($tracks);
echo json_encode($tracks); //, JSON_PRETTY_PRINT);
sort($tracks);
echo json_encode($tracks);
?>

0 comments on commit 71986c2

Please sign in to comment.