mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-24 23:28:40 +00:00
Return array of datetimes instead of values
This commit is contained in:
parent
5950c1fcf4
commit
a5039867ba
|
|
@ -290,19 +290,20 @@ class SmartDateTime extends \DateTime
|
|||
|
||||
// add difference to $weekStartsWith counting backwards from days of previous month (reorder so that lowest value first)
|
||||
for($i = $daysPreviousMonth - $diffToWeekStart; $i < $daysPreviousMonth; $i++) {
|
||||
$days[] = $i+1;
|
||||
$days[] = new \DateTime($previousMonth->format('Y') . '-' . $previousMonth->format('m') . '-' . ($i+1));
|
||||
}
|
||||
|
||||
// add normal count of current days
|
||||
$daysMonth = $this->getDaysOfMonth();
|
||||
for($i = 1; $i <= $daysMonth; $i++) {
|
||||
$days[] = $i;
|
||||
$days[] = new \DateTime($this->format('Y') . '-' . $this->format('m') . '-' . ($i));
|
||||
}
|
||||
|
||||
// add remaining days to next month (7*6 - difference+count of current month)
|
||||
$remainingDays = 42 - $diffToWeekStart - $daysMonth;
|
||||
$nextMonth = $this->createModify(0, 1);
|
||||
for($i = 1; $i <= $remainingDays; $i++) {
|
||||
$days[] = $i;
|
||||
$days[] = new \DateTime($nextMonth->format('Y') . '-' . $nextMonth->format('m') . '-' . ($i));
|
||||
}
|
||||
|
||||
return $days;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user