fix months

This commit is contained in:
2024-07-31 13:54:23 +02:00
parent 3d72531a48
commit 90fab36231
2 changed files with 18 additions and 2 deletions
+1 -2
View File
@@ -6,14 +6,13 @@ class MonthHelper
public function takeMonths() : array
{
$startDate = new \DateTime("-6 months");
$startDate->modify("first day of this month");
$return = [];
for ($i=1; $i<=11; $i++) {
$tmp = clone $startDate;
$tmp->modify("+$i month");
$return[$i] = $tmp;
}
return $return;
}