traditionLunarFestival property

String get traditionLunarFestival

传统农历节日

Implementation

String get traditionLunarFestival {
  if (lunarMonth == 12) {
    int count =
        ((_lunarInfo[lunarYear - 1900] & (0x100000 >> lunarMonth)) == 0)
            ? 29
            : 30;
    if (lunarDay == count) {
      return _traditionLunarFestivalList.first; //除夕
    }
  }
  String text = _getDateString(lunarMonth, lunarDay);
  String festivalStr = "";
  for (String festival in _traditionLunarFestivalList) {
    if (festival.contains(text)) {
      festivalStr = festival.replaceAll(text, "");
      break;
    }
  }
  return festivalStr;
}