v1.7.4 修复身宫报错的问题。
This commit is contained in:
@@ -36,3 +36,6 @@
|
|||||||
## [1.7.3] - 2025-04-07
|
## [1.7.3] - 2025-04-07
|
||||||
1. 修复个别日太岁方位的错误。
|
1. 修复个别日太岁方位的错误。
|
||||||
2. 修复八字身宫计算错误的问题。
|
2. 修复八字身宫计算错误的问题。
|
||||||
|
|
||||||
|
## [1.7.4] - 2025-04-29
|
||||||
|
1. 修复身宫报错的问题。
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ lunar是一款无第三方依赖的公历(阳历)、农历(阴历、老黄历)
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.6tail</groupId>
|
<groupId>cn.6tail</groupId>
|
||||||
<artifactId>lunar</artifactId>
|
<artifactId>lunar</artifactId>
|
||||||
<version>1.7.3</version>
|
<version>1.7.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ lunar is a calendar library for Solar and Chinese Lunar.
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.6tail</groupId>
|
<groupId>cn.6tail</groupId>
|
||||||
<artifactId>lunar</artifactId>
|
<artifactId>lunar</artifactId>
|
||||||
<version>1.7.3</version>
|
<version>1.7.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@@ -7,7 +7,7 @@
|
|||||||
<groupId>cn.6tail</groupId>
|
<groupId>cn.6tail</groupId>
|
||||||
<artifactId>lunar</artifactId>
|
<artifactId>lunar</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>1.7.3</version>
|
<version>1.7.4</version>
|
||||||
<name>${project.groupId}:${project.artifactId}</name>
|
<name>${project.groupId}:${project.artifactId}</name>
|
||||||
<url>https://github.com/6tail/lunar-java</url>
|
<url>https://github.com/6tail/lunar-java</url>
|
||||||
<description>a calendar library for Solar and Chinese Lunar</description>
|
<description>a calendar library for Solar and Chinese Lunar</description>
|
||||||
|
|||||||
@@ -527,12 +527,15 @@ public class EightChar {
|
|||||||
public String getShenGong() {
|
public String getShenGong() {
|
||||||
int monthZhiIndex = LunarUtil.find(getMonthZhi(), MONTH_ZHI, 0);
|
int monthZhiIndex = LunarUtil.find(getMonthZhi(), MONTH_ZHI, 0);
|
||||||
int timeZhiIndex = LunarUtil.find(getTimeZhi(), LunarUtil.ZHI, 0);
|
int timeZhiIndex = LunarUtil.find(getTimeZhi(), LunarUtil.ZHI, 0);
|
||||||
int offset = (monthZhiIndex + timeZhiIndex - 1) % 12;
|
int offset = monthZhiIndex + timeZhiIndex;
|
||||||
|
if (offset > 12) {
|
||||||
|
offset -= 12;
|
||||||
|
}
|
||||||
int ganIndex = (lunar.getYearGanIndexExact() + 1) * 2 + offset;
|
int ganIndex = (lunar.getYearGanIndexExact() + 1) * 2 + offset;
|
||||||
while (ganIndex > 10) {
|
while (ganIndex > 10) {
|
||||||
ganIndex -= 10;
|
ganIndex -= 10;
|
||||||
}
|
}
|
||||||
return LunarUtil.GAN[ganIndex + 1] + MONTH_ZHI[offset + 1];
|
return LunarUtil.GAN[ganIndex] + MONTH_ZHI[offset];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user