} // HasSameData // ---------------------------------------------------------------------- private static TimeRange ToCalendarTimeRange(ITimePeriod period, ITimePeriodMapper mapper) { DateTime mappedStart = mapper.MapStart(period.Start); DateTime mappedEnd = mapper.MapEnd(period.End); if (mappedEnd <= mappedStart) { throw new NotSupportedException(); } return(new TimeRange(mappedStart, mappedEnd)); } // ToCalendarTimeRange
/// <summary> /// 지정된 기간을 <paramref name="mapper"/>를 통해 매핑한 기간으로 반환합니다. /// </summary> /// <param name="period"></param> /// <param name="mapper"></param> /// <returns></returns> private static TimeRange ToCalendarTimeRange(ITimePeriod period, ITimePeriodMapper mapper) { period.ShouldNotBeNull("period"); mapper = mapper ?? new TimeCalendar(); var mappedStart = mapper.MapStart(period.Start); var mappedEnd = mapper.MapEnd(period.End); TimeTool.AssertValidPeriod(mappedStart, mappedEnd); var mapped = new TimeRange(mappedStart, mappedEnd); if (IsDebugEnabled) { log.Debug("TimeCalendar 기준의 기간으로 매핑했습니다. period=[{0}], mapped=[{1}]", period, mapped); } return(mapped); }
// ---------------------------------------------------------------------- private static TimeRange ToCalendarTimeRange( ITimePeriod period, ITimePeriodMapper mapper ) { DateTime mappedStart = mapper.MapStart( period.Start ); DateTime mappedEnd = mapper.MapEnd( period.End ); if ( mappedEnd <= mappedStart ) { throw new NotSupportedException(); } return new TimeRange( mappedStart, mappedEnd ); }