/// <summary> /// 返回指定公历日期对应的农历月 /// </summary> /// <param name="calendar"></param> /// <param name="date"></param> /// <returns></returns> public static string GetLunisolarMonth(this ChineseLunisolarCalendar calendar, DateTime date) { var month = calendar.GetMonth(date); var leapMonth = calendar.GetLeapMonth(calendar.GetYear(date), calendar.GetEra(date)); var isleep = leapMonth > 0 && leapMonth == month; if (leapMonth > 0) { if (leapMonth <= month) { month--; } } return(string.Concat(isleep ? "闰" : string.Empty, GetLunisolarMonth(month), "月")); }