getShenGong method
Implementation
String getShenGong() {
int monthZhiIndex = 0;
int timeZhiIndex = 0;
IndexValue? iv = LunarUtil.find(_lunar.getMonthZhiExact(), LunarUtil.MONTH_ZHI);
if (null != iv) {
monthZhiIndex = iv.getIndex();
}
iv = LunarUtil.find(_lunar.getTimeZhi(), LunarUtil.MONTH_ZHI);
if (null != iv) {
timeZhiIndex = iv.getIndex();
}
int zhiIndex = 2 + monthZhiIndex + timeZhiIndex;
if (zhiIndex > 12) {
zhiIndex -= 12;
}
int jiaZiIndex = LunarUtil.getJiaZiIndex(_lunar.getMonthInGanZhiExact()) -
(monthZhiIndex - zhiIndex);
if (jiaZiIndex >= 60) {
jiaZiIndex -= 60;
}
if (jiaZiIndex < 0) {
jiaZiIndex += 60;
}
return LunarUtil.JIA_ZI[jiaZiIndex];
}