lunarYearString property
String
get
lunarYearString
Implementation
String get lunarYearString {
String result = "";
int year = lunarYear;
if (year < 0) {
// 确保能读到正确的天干地支数据
year++;
}
if (year < 1900) {
// 把远古年代转到近代来计算天干地支
year += ((2018 - year) / 60).floor() * 60;
}
// int absYear = lunarYear.abs();
// String prefix = (lunarYear < 0 ? "公元前" : "") + "$absYear";
result = ((_tianganList[(year - 4) % _tianganList.length]) +
(_dizhiList[(year - 4) % _dizhiList.length]) +
"年");
return result;
}