mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-09 21:48:41 +00:00
Fix calendar month calculation
This commit is contained in:
parent
4e769fc979
commit
5950c1fcf4
|
|
@ -15,7 +15,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace phpOMS\Datatypes;
|
namespace phpOMS\Datatypes;
|
||||||
|
|
||||||
use phpOMS\Math\Functions;
|
use phpOMS\Math\Functions\Functions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SmartDateTime.
|
* SmartDateTime.
|
||||||
|
|
@ -290,7 +290,7 @@ class SmartDateTime extends \DateTime
|
||||||
|
|
||||||
// add difference to $weekStartsWith counting backwards from days of previous month (reorder so that lowest value first)
|
// add difference to $weekStartsWith counting backwards from days of previous month (reorder so that lowest value first)
|
||||||
for($i = $daysPreviousMonth - $diffToWeekStart; $i < $daysPreviousMonth; $i++) {
|
for($i = $daysPreviousMonth - $diffToWeekStart; $i < $daysPreviousMonth; $i++) {
|
||||||
$days[] = $i;
|
$days[] = $i+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// add normal count of current days
|
// add normal count of current days
|
||||||
|
|
@ -300,7 +300,8 @@ class SmartDateTime extends \DateTime
|
||||||
}
|
}
|
||||||
|
|
||||||
// add remaining days to next month (7*6 - difference+count of current month)
|
// add remaining days to next month (7*6 - difference+count of current month)
|
||||||
for($i = 42 - $daysPreviousMonth - $daysMonth; $i < 42; $i++) {
|
$remainingDays = 42 - $diffToWeekStart - $daysMonth;
|
||||||
|
for($i = 1; $i <= $remainingDays; $i++) {
|
||||||
$days[] = $i;
|
$days[] = $i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user