1
0
mirror of synced 2025-12-28 00:08:00 +08:00

新增每日宜忌

This commit is contained in:
6tail
2020-05-26 13:44:48 +08:00
parent 94189f364b
commit e860f920ac
3 changed files with 135 additions and 6 deletions

View File

@@ -1291,6 +1291,22 @@ public class Lunar{
return LunarUtil.POSITION_TAI_MONTH[month-1];
}
/**
* 获取每日宜
* @return 宜
*/
public List<String> getDayYi(){
return LunarUtil.getDayYi(getMonthInGanZhiExact(),getDayInGanZhi());
}
/**
* 获取每日忌,如果没有,返回["无"]
* @return 忌
*/
public List<String> getDayJi(){
return LunarUtil.getDayJi(getMonthInGanZhiExact(),getDayInGanZhi());
}
/**
* 获取节气表(节气名称:阳历),节气交接时刻精确到秒,以冬至开头,按先后顺序排列
* @return 节气表

View File

@@ -111,20 +111,20 @@ public class Solar{
double a = int2(julianDay);
// 日数的小数部分
double f = julianDay - a;
double D;
double jd;
if (a > 2299161) {
D = int2((a - 1867216.25) / 36524.25);
a += 1 + D - int2(D / 4);
jd = int2((a - 1867216.25) / 36524.25);
a += 1 + jd - int2(jd / 4);
}
// 向前移4年零2个月
a += 1524;
double y = int2((a - 122.1) / 365.25);
// 去除整年日数后余下日数
D = a - int2(365.25 * y);
double m = (int)int2(D / 30.6001);
jd = a - int2(365.25 * y);
double m = (int)int2(jd / 30.6001);
// 去除整月日数后余下日数
double d = (int)int2(D - int2(m * 30.6001));
double d = (int)int2(jd - int2(m * 30.6001));
y -= 4716;
m--;
if (m > 12) {

File diff suppressed because one or more lines are too long