From f3e87c195aa9732d20074b73aae992f1e1f693eb Mon Sep 17 00:00:00 2001 From: valentina Date: Mon, 3 Mar 2025 14:34:11 +0100 Subject: [PATCH] fix: #1617 impostazione filtro in statistiche --- modules/statistiche/edit.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/modules/statistiche/edit.php b/modules/statistiche/edit.php index c8c36242e..6a4df6aa2 100755 --- a/modules/statistiche/edit.php +++ b/modules/statistiche/edit.php @@ -36,6 +36,20 @@ $end = $_SESSION['period_end']; $translated_months = [tr('Gennaio'), tr('Febbraio'), tr('Marzo'), tr('Aprile'), tr('Maggio'), tr('Giugno'), tr('Luglio'), tr('Agosto'), tr('Settembre'), tr('Ottobre'), tr('Novembre'), tr('Dicembre')]; +$months = []; +$start_date = new DateTime($start); +$end_date = new DateTime($end); + +while ($start_date <= $end_date) { + $months[] = $start_date->format('F'); + $start_date->modify('+1 month'); +} + +foreach ($months as $key => $month) { + $month_number = date('n', strtotime($month)); + $months[$key] = $translated_months[$month_number - 1]; +} + // Fatturato echo '
@@ -415,7 +429,7 @@ echo ' echo '