Browse Source

Fix stats page

Jordi Boggiano 6 years ago
parent
commit
fa9e1dc817
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Packagist/WebBundle/Controller/WebController.php

+ 2 - 2
src/Packagist/WebBundle/Controller/WebController.php

@@ -230,12 +230,12 @@ class WebController extends Controller
         $count = 0;
         foreach ($packages as $dataPoint) {
             $count += $dataPoint['count'];
-            $chart['packages'][$dataPoint['year'] . '-' . $dataPoint['month']] = $count;
+            $chart['packages'][$dataPoint['year'] . '-' . str_pad($dataPoint['month'], 2, '0', STR_PAD_LEFT)] = $count;
         }
 
         $count = 0;
         foreach ($versions as $dataPoint) {
-            $yearMonth = $dataPoint['year'] . '-' . $dataPoint['month'];
+            $yearMonth = $dataPoint['year'] . '-' . str_pad($dataPoint['month'], 2, '0', STR_PAD_LEFT);
             $count += $dataPoint['count'];
             if (in_array($yearMonth, $chart['months'])) {
                 $chart['versions'][$yearMonth] = $count;