fix months
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user