earthBranchYear method
PWBEarthBranchModel
earthBranchYear()
Implementation
PWBEarthBranchModel earthBranchYear() {
int index = (theDate.year - 4) % 12;
if (theDate.month == 1) {
if (index == 0) {
index = 11;
} else {
index -= 1;
}
} else if (theDate.month == 2) {
if (theDate.isBefore(solarTerms[0].termDate)) {
if (index == 0) {
index = 11;
} else {
index -= 1;
}
}
}
return PWBEarthBranchModel(PWBEarchBranchEnum.values[index]);
}