Skip to content

Commit 93b27d5

Browse files
authored
Merge pull request #1649 from THORRDE/master
fix: #1648 visualizzazione grafici in statistiche
2 parents 2792a8b + d90547f commit 93b27d5

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

modules/statistiche/edit.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@
4141
$end_date = new DateTime($end);
4242

4343
while ($start_date <= $end_date) {
44-
$months[] = $start_date->format('F');
45-
$start_date->modify('+1 month');
44+
$month_number = $start_date->format('n'); // Ottiene il numero del mese (1-12)
45+
if (!in_array($month_number, $months)) { // Aggiunge il mese solo se non gia' presente
46+
$months[] = $month_number;
47+
}
48+
$start_date->modify('+1 month'); // Avanza al mese successivo
4649
}
47-
48-
foreach ($months as $key => $month) {
49-
$month_number = date('n', strtotime($month));
50-
$months[$key] = $translated_months[$month_number - 1];
50+
// Sostituisce i numeri con i nomi tradotti
51+
foreach ($months as $key => $month_number) {
52+
$months[$key] = $translated_months[$month_number - 1]; // Traduce il mese
5153
}
5254

5355
// Fatturato

0 commit comments

Comments
 (0)