getDayYi static method
Implementation
static List<String> getDayYi(String monthGanZhi, String dayGanZhi) {
List<String> l = <String>[];
String day = hex(getJiaZiIndex(dayGanZhi));
String month = hex(getJiaZiIndex(monthGanZhi));
String right = DAY_YI_JI;
int index = right.indexOf(day + '=');
while (index > -1) {
right = right.substring(index + 3);
String left = right;
if (left.contains('=')) {
left = left.substring(0, left.indexOf('=') - 2);
}
bool matched = false;
String months = left.substring(0, left.indexOf(':'));
for (int i = 0, j = months.length; i < j; i += 2) {
if (months.substring(i, i + 2) == month) {
matched = true;
break;
}
}
if (matched) {
String ys = left.substring(left.indexOf(':') + 1);
ys = ys.substring(0, ys.indexOf(','));
for (int i = 0, j = ys.length; i < j; i += 2) {
l.add(YI_JI[int.parse(ys.substring(i, i + 2), radix: 16)]);
}
break;
}
index = right.indexOf(day + '=');
}
if (l.isEmpty) {
l.add('无');
}
return l;
}