public static GetMonthsOfHalfyear ( this halfyear ) : int[] | ||
halfyear | this | |
Résultat | int[] |
/// <summary> /// 지정한 달력 기준으로 지정된 년도의 반기(전반기/후반기)의 기간 /// </summary> public static TimeSpan Halfyear(int year, HalfyearKind halfyear = HalfyearKind.First, Calendar calendar = null) { calendar = calendar ?? CurrentCalendar; var halfyearMonths = TimeTool.GetMonthsOfHalfyear(halfyear); var duration = TimeSpec.NoDuration; foreach (var halfyearMonth in halfyearMonths) { duration = duration.Add(Month(year, halfyearMonth, calendar)); } return(duration); }
public void GetMonthsOfHalfyearTest() { Assert.AreEqual(TimeSpec.FirstHalfyearMonths, TimeTool.GetMonthsOfHalfyear(HalfyearKind.First)); Assert.AreEqual(TimeSpec.SecondHalfyearMonths, TimeTool.GetMonthsOfHalfyear(HalfyearKind.Second)); }