1
0
mirror of synced 2025-12-26 23:38:00 +08:00

v1.1.15 修复八字流年计算错误。

This commit is contained in:
6tail
2020-11-27 13:05:36 +08:00
parent 554c474e4d
commit bd19489441
2 changed files with 75 additions and 1 deletions

View File

@@ -53,7 +53,8 @@ public class LiuNian {
* @return 干支
*/
public String getGanZhi() {
int offset = LunarUtil.getJiaZiIndex(lunar.getYearInGanZhiExact()) + this.index;
// 干支与出生日期和起运日期都没关系
int offset = LunarUtil.getJiaZiIndex(lunar.getJieQiTable().get("立春").getLunar().getYearInGanZhiExact()) + this.index;
if (daYun.getIndex() > 0) {
offset += daYun.getStartAge() - 1;
}