1
0
mirror of synced 2026-10-22 14:36:12 +08:00

v1.2.5 修复公元0至4年转阴历错误的问题。

This commit is contained in:
6tail
2021-09-17 22:09:07 +08:00
parent 012649009a
commit 2694429549
7 changed files with 86 additions and 7 deletions

View File

@@ -22,7 +22,7 @@ public class Lunar {
/**
* 实际的节气表
*/
public static final String[] JIE_QI_IN_USE = {"DA_XUE", "冬至", "小寒", "大寒", "立春", "雨水", "惊蛰", "春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑", "立秋", "处暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "DONG_ZHI", "XIAO_HAN", "DA_HAN", "LI_CHUN"};
public static final String[] JIE_QI_IN_USE = {"DA_XUE", "冬至", "小寒", "大寒", "立春", "雨水", "惊蛰", "春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑", "立秋", "处暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "DONG_ZHI", "XIAO_HAN", "DA_HAN", "LI_CHUN", "YU_SHUI", "JING_ZHE"};
/**
* 农历年
@@ -242,6 +242,14 @@ public class Lunar {
yearGanIndex = offset % 10;
yearZhiIndex = offset % 12;
if (yearGanIndex < 0) {
yearGanIndex += 10;
}
if (yearZhiIndex < 0) {
yearZhiIndex += 12;
}
//以立春作为新一年的开始的干支纪年
int g = yearGanIndex;
int z = yearZhiIndex;
@@ -819,6 +827,10 @@ public class Lunar {
jq = "立春";
}else if("DA_XUE".equals(jq)){
jq = "大雪";
} else if ("YU_SHUI".equals(jq)) {
jq = "雨水";
} else if ("JING_ZHE".equals(jq)) {
jq = "惊蛰";
}
return jq;
}