File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4141$ end_date = new DateTime ($ end );
4242
4343while ($ 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
You can’t perform that action at this time.
0 commit comments