v1.2.26 修复物候的错误。
This commit is contained in:
3
pom.xml
3
pom.xml
@@ -7,7 +7,7 @@
|
||||
<groupId>cn.6tail</groupId>
|
||||
<artifactId>lunar</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.2.25</version>
|
||||
<version>1.2.26</version>
|
||||
<name>${project.groupId}:${project.artifactId}</name>
|
||||
<url>https://github.com/6tail/lunar-java</url>
|
||||
<description>a calendar library for Solar and Chinese Lunar</description>
|
||||
@@ -105,6 +105,7 @@
|
||||
</goals>
|
||||
<configuration>
|
||||
<additionalparam>-Xdoclint:none</additionalparam>
|
||||
<source>${source-version}</source>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
|
||||
@@ -2990,7 +2990,11 @@ public class Lunar {
|
||||
}
|
||||
Solar startSolar = jieQi.getSolar();
|
||||
int days = ExactDate.getDaysBetween(startSolar.getYear(), startSolar.getMonth(), startSolar.getDay(), solar.getYear(), solar.getMonth(), solar.getDay());
|
||||
return LunarUtil.WU_HOU[(offset * 3 + days / 5) % LunarUtil.WU_HOU.length];
|
||||
int index = days / 5;
|
||||
if (index > 2) {
|
||||
index = 2;
|
||||
}
|
||||
return LunarUtil.WU_HOU[(offset * 3 + index) % LunarUtil.WU_HOU.length];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -103,4 +103,18 @@ public class WuHouTest {
|
||||
Assert.assertEquals(solar.toString(),"小寒 初候",lunar.getHou());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test15(){
|
||||
Solar solar = new Solar(2022,8,22);
|
||||
Lunar lunar = solar.getLunar();
|
||||
Assert.assertEquals(solar.toString(),"寒蝉鸣",lunar.getWuHou());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test16(){
|
||||
Solar solar = new Solar(2022,8,23);
|
||||
Lunar lunar = solar.getLunar();
|
||||
Assert.assertEquals(solar.toString(),"鹰乃祭鸟",lunar.getWuHou());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user