isLuckyDay property
bool
get
isLuckyDay
Checks if the Lunar date is a lucky day.
Implementation
bool get isLuckyDay {
var checkMonth = (month - 1) % 6;
var branchOfDay = stemBranchOfDay.branch;
final List<int> louisSequence = _convertToLouisSequence(2);
final List<Branch> orderedBranch =
_orderedBranchToCheckLuckyDay(checkMonth);
var isLucky = true;
var result = false;
var index = 0;
for (var element in louisSequence) {
while (element > 0) {
if (orderedBranch[index] == branchOfDay) {
result = isLucky;
}
index++;
element--;
}
isLucky = !isLucky;
}
return result;
}