Skip to content

Commit

Permalink
Merge pull request #20 from hao-li/master
Browse files Browse the repository at this point in the history
fix bugs
  • Loading branch information
overtrue authored Jul 23, 2018
2 parents 857257f + c20d2b0 commit 3775d24
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ protected function getColor($ganZhi)
return null;
}

return $this->colors[array_search($this->gan, $gan)];
return $this->colors[array_search($gan, $this->gan)];
}

/**
Expand All @@ -549,7 +549,7 @@ protected function getWuXing($ganZhi)
return null;
}

return $this->wuXing[array_search($this->gan, $gan)];
return $this->wuXing[array_search($gan, $this->gan)];
}

/**
Expand Down Expand Up @@ -659,7 +659,8 @@ public function solar2lunar($year, $month, $day, $hour = null)
if ($secondNode == $day) {
$termIndex = $month * 2 - 1;
}
$term = $this->solarTerm[$termIndex];

$term = null != $termIndex ? $this->solarTerm[$termIndex] : null;

// 日柱 当月一日与 1900/1/1 相差天数
$dayCyclical = $this->dateDiff("{$year}-{$month}-01", '1900-01-01')->days + 10;
Expand Down

0 comments on commit 3775d24

Please sign in to comment.