Skip to content

Commit

Permalink
Merge pull request #13 from bhulsman/master
Browse files Browse the repository at this point in the history
Sort hourly statistics by newest first. Fixes #12
  • Loading branch information
alexandermarston committed Oct 3, 2018
2 parents 58b1ce1 + 4bed524 commit 385c312
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vnstat.php
Expand Up @@ -179,12 +179,12 @@ function get_vnstat_data($path, $type, $interface) {

usort($hourlyGraph, function ($item1, $item2) {
if ($item1['time'] == $item2['time']) return 0;
return $item1['time'] < $item2['time'] ? -1 : 1;
return $item1['time'] > $item2['time'] ? -1 : 1;
});

usort($hourly, function ($item1, $item2) {
if ($item1['time'] == $item2['time']) return 0;
return $item1['time'] < $item2['time'] ? -1 : 1;
return $item1['time'] > $item2['time'] ? -1 : 1;
});

usort($dailyGraph, function ($item1, $item2) {
Expand Down

0 comments on commit 385c312

Please sign in to comment.