Skip to content

Commit

Permalink
v1.2.18 增强兼容性。
Browse files Browse the repository at this point in the history
  • Loading branch information
6tail committed May 26, 2022
1 parent 5ad8d81 commit ed8637f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Lunar.php
Original file line number Diff line number Diff line change
Expand Up @@ -2240,7 +2240,7 @@ public static function shuoHigh($w)
{
$t = ShouXingUtil::msaLonT2($w) * 36525;
$t = $t - ShouXingUtil::dtT($t) + ShouXingUtil::$ONE_THIRD;
$v = (($t + 0.5) % 1) * ShouXingUtil::$SECOND_PER_DAY;
$v = (intval($t + 0.5) % 1) * ShouXingUtil::$SECOND_PER_DAY;
if ($v < 1800 || $v > ShouXingUtil::$SECOND_PER_DAY - 1800) {
$t = ShouXingUtil::msaLont($w) * 36525 - ShouXingUtil::dtT($t) + ShouXingUtil::$ONE_THIRD;
}
Expand Down Expand Up @@ -4164,7 +4164,8 @@ public function getPositionFu()
*/
public function getPositionFuBySect($sect)
{
return (1 == $sect ? LunarUtil::$POSITION_FU : LunarUtil::$POSITION_FU_2)[$this->ganIndex + 1];
$fu = 1 == $sect ? LunarUtil::$POSITION_FU : LunarUtil::$POSITION_FU_2;
return $fu[$this->ganIndex + 1];
}

/**
Expand Down Expand Up @@ -5672,7 +5673,8 @@ public function getDayPositionFu()
*/
public function getDayPositionFuBySect($sect)
{
return (1 == $sect ? LunarUtil::$POSITION_FU : LunarUtil::$POSITION_FU_2)[$this->dayGanIndex + 1];
$fu = 1 == $sect ? LunarUtil::$POSITION_FU : LunarUtil::$POSITION_FU_2;
return $fu[$this->dayGanIndex + 1];
}

/**
Expand Down Expand Up @@ -5710,7 +5712,8 @@ public function getTimePositionFu()
*/
public function getTimePositionFuBySect($sect)
{
return (1 == $sect ? LunarUtil::$POSITION_FU : LunarUtil::$POSITION_FU_2)[$this->timeGanIndex + 1];
$fu = 1 == $sect ? LunarUtil::$POSITION_FU : LunarUtil::$POSITION_FU_2;
return $fu[$this->timeGanIndex + 1];
}

/**
Expand Down Expand Up @@ -7159,7 +7162,7 @@ public function getShuJiu()
return null;
}
$days = ExactDate::getDaysBetweenDate($startCalendar, $currentCalendar);
return new ShuJiu(LunarUtil::$NUMBER[$days / 9 + 1] . '', $days % 9 + 1);
return new ShuJiu(LunarUtil::$NUMBER[intval($days / 9) + 1] . '', $days % 9 + 1);
}

public function getFu()
Expand Down Expand Up @@ -7955,7 +7958,8 @@ public function getPositionFu()
*/
public function getPositionFuBySect($sect)
{
return (1 == $sect ? LunarUtil::$POSITION_FU : LunarUtil::$POSITION_FU_2)[$this->ganIndex + 1];
$fu = 1 == $sect ? LunarUtil::$POSITION_FU : LunarUtil::$POSITION_FU_2;
return $fu[$this->ganIndex + 1];
}

/**
Expand Down

0 comments on commit ed8637f

Please sign in to comment.