Skip to content

Commit

Permalink
v1.3.1 修复八字转阳历极端情况下仍然有遗漏的问题。
Browse files Browse the repository at this point in the history
  • Loading branch information
6tail committed Feb 7, 2023
1 parent 09baeb4 commit 3a9fe80
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/com/nlf/calendar/Solar.java
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,13 @@ public static List<Solar> fromBaZi(String yearGanZhi, String monthGanZhi, String
offsetYear += 60;
}
int startYear = today.getYear() - offsetYear - 1;
while (startYear >= baseYear) {
while (true) {
years.add(startYear);
startYear -= 60;
if (startYear < baseYear) {
years.add(baseYear);
break;
}
}
int hour = 0;
String timeZhi = timeGanZhi.substring(1);
Expand Down

0 comments on commit 3a9fe80

Please sign in to comment.