feat: VarTurn60::cutDay()
This commit is contained in:
@@ -136,6 +136,18 @@ class VarTurn60
|
|||||||
return TimeUtil::format($date, $withFraction);
|
return TimeUtil::format($date, $withFraction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function cutDay($withFraction = true): array{
|
||||||
|
//고정 시간 기준 cutDay()의 이식
|
||||||
|
//상수 테이블이 이미 13:00에 1월이 되도록 맞춰져 있음.
|
||||||
|
//다만 20:00인 경우 8월이 아니라 9월이 됨 ^^;
|
||||||
|
$newMonth = ($this->turnIdx + static::MonthAdjustOffset) % 12 + 1;
|
||||||
|
[$date, ] = $this->cutTurn($withFraction);
|
||||||
|
|
||||||
|
$yearPulled = $newMonth > 3;
|
||||||
|
|
||||||
|
return [$date, $yearPulled, $newMonth];
|
||||||
|
}
|
||||||
|
|
||||||
function addTurn(int $moreTurn): self{
|
function addTurn(int $moreTurn): self{
|
||||||
$dayDiff = intdiv($moreTurn, 24);
|
$dayDiff = intdiv($moreTurn, 24);
|
||||||
$moreTurn %= 24;
|
$moreTurn %= 24;
|
||||||
|
|||||||
Reference in New Issue
Block a user