Exemplo n.º 1
0
 // ----------------------------------------------------------------------
 protected MinuteTimeRange( int startYear, int startMonth, int startDay, int startHour, int startMinute, int minuteCount, ITimeCalendar calendar )
     : base(GetPeriodOf( startYear, startMonth, startDay, startHour, startMinute, minuteCount ), calendar)
 {
     this.startMinute = new DateTime( startYear, startMonth, startDay, startHour, startMinute, 0 );
     this.minuteCount = minuteCount;
     endMinute = this.startMinute.AddMinutes( minuteCount );
 }
Exemplo n.º 2
0
 // ----------------------------------------------------------------------
 protected WeekTimeRange( int year, int startWeek, int weekCount, ITimeCalendar calendar )
     : base(GetPeriodOf( year, startWeek, weekCount, calendar ), calendar)
 {
     this.year = year;
     this.startWeek = startWeek;
     this.weekCount = weekCount;
 }
Exemplo n.º 3
0
        public CalendarDateDiff(ITimeCalendar timeCalendar) {
            timeCalendar.ShouldNotBeNull("timeCalendar");
            Guard.Assert(timeCalendar.StartOffset == TimeSpan.Zero, "Calendar의 StartOffset은 TimeSpan.Zero이어야 합니다.");
            Guard.Assert(timeCalendar.EndOffset == TimeSpan.Zero, "Calendar의 StartOffset은 TimeSpan.Zero이어야 합니다.");

            _calendar = timeCalendar;
        }
Exemplo n.º 4
0
 // ----------------------------------------------------------------------
 protected YearTimeRange( int startYear, int yearCount, ITimeCalendar calendar )
     : base(GetPeriodOf( calendar.YearBaseMonth, startYear, yearCount ), calendar)
 {
     this.startYear = startYear;
     this.yearCount = yearCount;
     endYear = End.Year;
 }
Exemplo n.º 5
0
 // ----------------------------------------------------------------------
 protected HourTimeRange( int startYear, int startMonth, int startDay, int startHour, int hourCount, ITimeCalendar calendar )
     : base(GetPeriodOf( startYear, startMonth, startDay, startHour, hourCount ), calendar)
 {
     this.startHour = new DateTime( startYear, startMonth, startDay, startHour, 0, 0 );
     this.hourCount = hourCount;
     endHour = this.startHour.AddHours( hourCount );
 }
Exemplo n.º 6
0
 // ----------------------------------------------------------------------
 protected DayTimeRange( int startYear, int startMonth, int startDay, int dayCount, ITimeCalendar calendar )
     : base(GetPeriodOf( startYear, startMonth, startDay, dayCount ), calendar)
 {
     this.startDay = new DateTime( startYear, startMonth, startDay );
     this.dayCount = dayCount;
     endDay = calendar.MapEnd( this.startDay.AddDays( dayCount ) );
 }
Exemplo n.º 7
0
 // ----------------------------------------------------------------------
 public static DateTime CalcTimeMoment( DateTime baseMoment, TimeUnit offsetUnit, long offsetCount = 1, ITimeCalendar calendar = null )
 {
     switch ( offsetUnit )
     {
         case TimeUnit.Tick:
             return baseMoment.AddTicks( offsetCount );
         case TimeUnit.Millisecond:
             DateTime offsetMillisecond = baseMoment.AddSeconds( offsetCount );
             return TimeTrim.Millisecond( offsetMillisecond, offsetMillisecond.Millisecond );
         case TimeUnit.Second:
             DateTime offsetSecond = baseMoment.AddSeconds( offsetCount );
             return TimeTrim.Second( offsetSecond, offsetSecond.Second );
         case TimeUnit.Minute:
             return new Minute(baseMoment, calendar).AddMinutes( ToInt( offsetCount ) ).Start;
         case TimeUnit.Hour:
             return new Hour( baseMoment, calendar ).AddHours( ToInt( offsetCount ) ).Start;
         case TimeUnit.Day:
             return new Day( baseMoment, calendar ).AddDays( ToInt( offsetCount ) ).Start;
         case TimeUnit.Week:
             return new Week( baseMoment, calendar ).AddWeeks( ToInt( offsetCount ) ).Start;
         case TimeUnit.Month:
             return new Month( baseMoment, calendar ).AddMonths( ToInt( offsetCount ) ).Start;
         case TimeUnit.Quarter:
             return new Quarter( baseMoment, calendar ).AddQuarters( ToInt( offsetCount ) ).Start;
         case TimeUnit.Halfyear:
             return new Halfyear( baseMoment, calendar ).AddHalfyears( ToInt( offsetCount ) ).Start;
         case TimeUnit.Year:
             return new Year( baseMoment, calendar ).AddYears( ToInt( offsetCount ) ).Start;
         default:
             throw new InvalidOperationException();
     }
 }
Exemplo n.º 8
0
 // ----------------------------------------------------------------------
 protected HalfyearTimeRange( int startYear, YearHalfyear startHalfyear, int halfyearCount, ITimeCalendar calendar )
     : base(GetPeriodOf( calendar.YearBaseMonth, startYear, startHalfyear, halfyearCount ), calendar)
 {
     this.startYear = startYear;
     this.startHalfyear = startHalfyear;
     this.halfyearCount = halfyearCount;
     TimeTool.AddHalfyear( startYear, startHalfyear, halfyearCount - 1, out endYear, out endHalfyear );
 }
Exemplo n.º 9
0
 // ----------------------------------------------------------------------
 protected MonthTimeRange( int startYear, YearMonth startMonth, int monthCount, ITimeCalendar calendar )
     : base(GetPeriodOf( startYear, startMonth, monthCount ), calendar)
 {
     this.startYear = startYear;
     this.startMonth = startMonth;
     this.monthCount = monthCount;
     TimeTool.AddMonth( startYear, startMonth, monthCount - 1, out endYear, out endMonth );
 }
Exemplo n.º 10
0
 // ----------------------------------------------------------------------
 protected QuarterTimeRange( int startYear, YearQuarter startQuarter, int quarterCount, ITimeCalendar calendar )
     : base(GetPeriodOf( calendar.YearBaseMonth, startYear, startQuarter, quarterCount ), calendar)
 {
     this.startYear = startYear;
     this.startQuarter = startQuarter;
     this.quarterCount = quarterCount;
     TimeTool.AddQuarter( startYear, startQuarter, quarterCount - 1, out endYear, out endQuarter );
 }
Exemplo n.º 11
0
        protected HalfyearTimeRange(int startYear, HalfyearKind startHalfyearKind, int halfyearCount, ITimeCalendar calendar)
            : base(GetPeriodOf(calendar.YearBaseMonth, startYear, startHalfyearKind, halfyearCount), calendar) {
            StartYear = startYear;
            StartHalfyear = startHalfyearKind;

            HalfyearCount = halfyearCount;

            var endYearAndHalfyear = TimeTool.AddHalfyear(startHalfyearKind, startYear, halfyearCount - 1);
            EndYear = endYearAndHalfyear.Year ?? StartYear;
            EndHalfyear = endYearAndHalfyear.Halfyear ?? StartHalfyear;
        }
Exemplo n.º 12
0
 // ----------------------------------------------------------------------
 public CalendarDateDiff( ITimeCalendar calendar )
 {
     if ( calendar == null )
     {
         throw new ArgumentNullException( "calendar" );
     }
     if ( calendar.StartOffset != TimeSpan.Zero )
     {
         throw new ArgumentOutOfRangeException( "calendar", "start offset" );
     }
     if ( calendar.EndOffset != TimeSpan.Zero )
     {
         throw new ArgumentOutOfRangeException( "calendar", "end offset" );
     }
     this.calendar = calendar;
 }
Exemplo n.º 13
0
 // ----------------------------------------------------------------------
 public static ITimePeriod CalcTimePeriod( DateTime baseMoment, TimeUnit periodUnit, long periodDuration = 1,
     TimeUnit? offsetUnit = null, long offsetCount = 1, ITimeCalendar calendar = null)
 {
     if ( !offsetUnit.HasValue )
     {
         offsetUnit = periodUnit;
     }
     DateTime start = CalcTimeMoment( baseMoment, offsetUnit.Value, offsetCount, calendar );
     switch ( periodUnit )
     {
         case TimeUnit.Tick:
             return new TimeRange( start, start.AddTicks( periodDuration ) );
         case TimeUnit.Millisecond:
             return new TimeRange( start, start.AddMilliseconds( periodDuration ) );
         case TimeUnit.Second:
             return new TimeRange( start, start.AddSeconds( periodDuration ) );
         case TimeUnit.Minute:
             return periodDuration == 1 ? new Minute( start, calendar ) as ITimePeriod : new Minutes( start, ToInt( periodDuration ), calendar );
         case TimeUnit.Hour:
             return periodDuration == 1 ? new Hour( start, calendar ) as ITimePeriod : new Hours( start, ToInt( periodDuration ), calendar );
         case TimeUnit.Day:
             return periodDuration == 1 ? new Day( start, calendar ) as ITimePeriod : new Days( start, ToInt( periodDuration ), calendar );
         case TimeUnit.Week:
             return periodDuration == 1 ? new Week( start, calendar ) as ITimePeriod : new Weeks( start, ToInt( periodDuration ), calendar );
         case TimeUnit.Month:
             YearMonth startMonth = calendar != null ? calendar.YearBaseMonth : TimeSpec.CalendarYearStartMonth;
             return periodDuration == 1 ? new Month( start, calendar ) as ITimePeriod : new Months( start, startMonth, ToInt( periodDuration ), calendar );
         case TimeUnit.Quarter:
             return periodDuration == 1 ? new Quarter( start, calendar ) as ITimePeriod : new Quarters( start, YearQuarter.First, ToInt( periodDuration ), calendar );
         case TimeUnit.Halfyear:
             return periodDuration == 1 ? new Halfyear( start, calendar ) as ITimePeriod : new Halfyears( start, YearHalfyear.First, ToInt( periodDuration ), calendar );
         case TimeUnit.Year:
             return periodDuration == 1 ? new Year( start, calendar ) as ITimePeriod : new Years( start, ToInt( periodDuration ), calendar );
         default:
             throw new InvalidOperationException();
     }
 }
Exemplo n.º 14
0
        }         // GetPeriodOf

        // ----------------------------------------------------------------------
        private static TimeRange GetPeriodOf(int year, int weekOfYear, int weekCount, ITimeCalendar calendar)
        {
            if (weekCount < 1)
            {
                throw new ArgumentOutOfRangeException("weekCount");
            }

            DateTime start = TimeTool.GetStartOfYearWeek(year, weekOfYear, calendar.Culture, calendar.YearWeekType);
            DateTime end   = start.AddDays(weekCount * TimeSpec.DaysPerWeek);

            return(new TimeRange(start, end));
        }         // GetPeriodOf
Exemplo n.º 15
0
 /// <summary>
 /// <paramref name="moment"/>가 속한 하루서부터 <paramref name="hourCount"/>만큼의 시간의 기간
 /// </summary>
 public static HourRangeCollection GetHourRanges(this DateTime moment, int hourCount, ITimeCalendar timeCalendar = null) {
     return new HourRangeCollection(moment, hourCount, timeCalendar ?? TimeCalendar.New());
 }
Exemplo n.º 16
0
        }         // BroadcastMonth

        // ----------------------------------------------------------------------
        public BroadcastMonth(DateTime moment, ITimeCalendar calendar) :
            this(GetYearOf(moment), GetMonthOf(moment), calendar)
        {
        }         // BroadcastMonth
Exemplo n.º 17
0
 public MonthRangeCollection(int year, int month, int monthCount, ITimeCalendar calendar)
     : base(year, month, monthCount, calendar)
 {
 }
Exemplo n.º 18
0
        }         // QuarterTimeRange

        // ----------------------------------------------------------------------
        protected QuarterTimeRange(int startYear, YearQuarter startQuarter, int quarterCount, ITimeCalendar calendar) :
            base(GetPeriodOf(calendar, startYear, startQuarter, quarterCount), calendar)
        {
            this.startYear    = startYear;
            this.startQuarter = startQuarter;
            this.quarterCount = quarterCount;
            TimeTool.AddQuarter(startYear, startQuarter, quarterCount - 1, out endYear, out endQuarter);
        }         // QuarterTimeRange
Exemplo n.º 19
0
        }         // Hours

        // ----------------------------------------------------------------------
        public Hours(DateTime moment, int count, ITimeCalendar calendar) :
            this(calendar.GetYear(moment), calendar.GetMonth(moment),
                 calendar.GetDayOfMonth(moment), calendar.GetHour(moment), count, calendar)
        {
        }         // Hours
Exemplo n.º 20
0
 public BroadcastYear(int year, ITimeCalendar calendar)
     : base(GetPeriodOf(year), calendar)
 {
     Year = year;
 }
Exemplo n.º 21
0
        }         // Minute

        // ----------------------------------------------------------------------
        public Minute(ITimeCalendar calendar) :
            this(ClockProxy.Clock.Now, calendar)
        {
        }         // Minute
Exemplo n.º 22
0
 public BroadcastYear(ITimeCalendar calendar)
     : this(ClockProxy.Clock.Now, calendar)
 {
 }
Exemplo n.º 23
0
 public BroadcastYear(DateTime moment, ITimeCalendar calendar)
     : this(GetYearOf(moment), calendar)
 {
 }
Exemplo n.º 24
0
        }                                                          // Weeks

        // ----------------------------------------------------------------------
        public Weeks(int year, int startWeek, int count, ITimeCalendar calendar) :
            base(year, startWeek, count, calendar)
        {
        }                                               // Weeks
Exemplo n.º 25
0
        }                                                 // Weeks

        // ----------------------------------------------------------------------
        public Weeks(DateTime moment, int count, ITimeCalendar calendar) :
            base(moment, count, calendar)
        {
        }                                      // Weeks
Exemplo n.º 26
0
        }         // WeekTimeRange

        // ----------------------------------------------------------------------
        protected WeekTimeRange(DateTime moment, int weekCount, ITimeCalendar calendar) :
            base(GetPeriodOf(moment, weekCount, calendar), calendar)
        {
            TimeTool.GetWeekOfYear(moment, calendar.Culture, calendar.YearWeekType, out year, out startWeek);
            this.weekCount = weekCount;
        }         // WeekTimeRange
Exemplo n.º 27
0
 /// <summary>
 /// <paramref name="moment"/>가 속한 하루서부터 <paramref name="minuteCount"/>만큼의 분의 기간
 /// </summary>
 public static MinuteRangeCollection GetMinuteRanges(this DateTime moment, int minuteCount, ITimeCalendar timeCalendar = null) {
     return new MinuteRangeCollection(moment, minuteCount, timeCalendar ?? TimeCalendar.New());
 }
Exemplo n.º 28
0
        }         // Minute

        // ----------------------------------------------------------------------
        public Minute(DateTime moment, ITimeCalendar calendar) :
            this(calendar.GetYear(moment), calendar.GetMonth(moment), calendar.GetDayOfMonth(moment),
                 calendar.GetHour(moment), calendar.GetMinute(moment), calendar)
        {
        }         // Minute
Exemplo n.º 29
0
 public QuarterRange(int year, QuarterKind quarter, ITimeCalendar calendar) : base(year, quarter, 1, calendar) {}
Exemplo n.º 30
0
 public MonthRangeCollection(DateTime moment, int monthCount, ITimeCalendar calendar) : base(moment, monthCount, calendar)
 {
 }
Exemplo n.º 31
0
 protected DayTimeRange(DateTime moment, int dayCount, ITimeCalendar calendar)
     : this(calendar.GetYear(moment), calendar.GetMonth(moment), calendar.GetDayOfMonth(moment), dayCount, calendar)
 {
 }
Exemplo n.º 32
0
 // ----------------------------------------------------------------------
 public Year( DateTime moment, ITimeCalendar calendar )
     : this(TimeTool.GetYearOf( calendar.YearBaseMonth, calendar.GetYear( moment ), calendar.GetMonth( moment ) ), calendar)
 {
 }
Exemplo n.º 33
0
        }         // Hours

        // ----------------------------------------------------------------------
        public Hours(int startYear, int startMonth, int startDay, int hour, int hourCount, ITimeCalendar calendar) :
            base(startYear, startMonth, startDay, hour, hourCount, calendar)
        {
        }         // Hours
Exemplo n.º 34
0
        /// <summary>
        ///  <paramref name="moment"/>이 속하면서, <paramref name="periodKind"/>에 해당하는 <see cref="ICalendarTimeRange"/>을 구합니다.
        /// </summary>
        /// <param name="moment"></param>
        /// <param name="periodKind"></param>
        /// <param name="periodCount"></param>
        /// <param name="timeCalendar"></param>
        /// <returns></returns>
        public static ICalendarTimeRange GetPeriodsOf(this DateTime moment, PeriodKind periodKind, int periodCount,
                                                      ITimeCalendar timeCalendar) {
            if(IsDebugEnabled)
                log.Debug("날짜[{0}]가 속한 기간종류[{1}]의 기간을 구합니다. periodCount=[{2}], timeCalendar=[{3}]",
                          moment.ToSortableString(), periodKind, periodCount, timeCalendar);

            switch(periodKind) {
                case PeriodKind.Year:
                    return GetYearRanges(moment, periodCount, timeCalendar);

                case PeriodKind.Halfyear:
                    return GetHalfyearRanges(moment, periodCount, timeCalendar);

                case PeriodKind.Quarter:
                    return GetQuarterRanges(moment, periodCount, timeCalendar);

                case PeriodKind.Month:
                    return GetMonthRanges(moment, periodCount, timeCalendar);

                case PeriodKind.Week:
                    return GetWeekRanges(moment, periodCount, timeCalendar);

                case PeriodKind.Day:
                    return GetDayRanges(moment, periodCount, timeCalendar);

                case PeriodKind.Hour:
                    return GetHourRanges(moment, periodCount, timeCalendar);

                case PeriodKind.Minute:
                    return GetMinuteRanges(moment, periodCount, timeCalendar);

                case PeriodKind.Second:
                    return new CalendarTimeRange(moment.TrimToMillisecond(), DurationUtil.Seconds(periodCount), timeCalendar);

                default:
                    throw new NotSupportedException("지원하지 않는 TimePeriod 종류입니다. periodKind=" + periodKind);
            }
        }
Exemplo n.º 35
0
        }         // BroadcastMonth

        // ----------------------------------------------------------------------
        public BroadcastMonth(int year, YearMonth month, ITimeCalendar calendar) :
            base(GetPeriodOf(year, month), calendar)
        {
            this.year  = year;
            this.month = month;
        }         // BroadcastMonth
Exemplo n.º 36
0
 /// <summary>
 /// <paramref name="moment"/>가 속한 분기부터 <paramref name="quarterCount"/> 갯수의 분기까지의 기간
 /// </summary>
 /// <param name="moment">기준 일자</param>
 /// <param name="quarterCount">분기 수</param>
 /// <param name="timeCalendar">기준 TimeCalendar</param>
 public static QuarterRangeCollection GetQuarterRanges(this DateTime moment, int quarterCount, ITimeCalendar timeCalendar = null) {
     return new QuarterRangeCollection(moment, quarterCount, timeCalendar ?? TimeCalendar.New());
 }
Exemplo n.º 37
0
        }         // BroadcastMonth

        // ----------------------------------------------------------------------
        public BroadcastMonth(ITimeCalendar calendar) :
            this(ClockProxy.Clock.Now, calendar)
        {
        }         // BroadcastMonth
Exemplo n.º 38
0
 /// <summary>
 /// <paramref name="moment"/>가 속한 하루서부터 <paramref name="dayCount"/>만큼의 일자의 기간
 /// </summary>
 public static DayRangeCollection GetDayRanges(this DateTime moment, int dayCount, ITimeCalendar timeCalendar = null) {
     return new DayRangeCollection(moment, dayCount, timeCalendar ?? TimeCalendar.New());
 }
Exemplo n.º 39
0
 public HourRangeCollection(int year, int month, int day, int hour, int hourCount, ITimeCalendar calendar)
     : base(year, month, day, hour, hourCount, calendar) {}
Exemplo n.º 40
0
        }         // Minute

        // ----------------------------------------------------------------------
        public Minute(int year, int month, int day, int hour, int minute, ITimeCalendar calendar) :
            base(year, month, day, hour, minute, 1, calendar)
        {
        }         // Minute
Exemplo n.º 41
0
 public CalendarTimeRange(DateTime start, DateTime end, ITimeCalendar timeCalendar)
     : this(new TimeRange(start, end), timeCalendar)
 {
 }
Exemplo n.º 42
0
        }                                                                             // Quarters

        // ----------------------------------------------------------------------
        public Quarters(int startYear, YearQuarter startYearQuarter, int quarterCount, ITimeCalendar calendar) :
            base(startYear, startYearQuarter, quarterCount, calendar)
        {
        }                                                                  // Quarters
Exemplo n.º 43
0
 public HourRangeCollection(DateTime moment, int hourCount, ITimeCalendar calendar) : base(moment, hourCount, calendar) {}
Exemplo n.º 44
0
 public CalendarTimeRange(DateTime start, TimeSpan duration, ITimeCalendar timeCalendar)
     : this(new TimeRange(start, duration), timeCalendar)
 {
 }
Exemplo n.º 45
0
 // ----------------------------------------------------------------------
 public Year( ITimeCalendar calendar )
     : this(ClockProxy.Clock.Now, calendar)
 {
 }
Exemplo n.º 46
0
 public CalendarTimeRange(ITimePeriod period, ITimeCalendar timeCalendar)
     : base(ToCalendarTimeRange(period, timeCalendar), true)
 {
     TimeCalendar = timeCalendar;
 }
Exemplo n.º 47
0
 // ----------------------------------------------------------------------
 public Year( int year, ITimeCalendar calendar )
     : base(year, 1, calendar)
 {
 }
Exemplo n.º 48
0
        }         // DayTimeRange

        // ----------------------------------------------------------------------
        protected DayTimeRange(int startYear, int startMonth, int startDay, int dayCount, ITimeCalendar calendar) :
            base(GetPeriodOf(startYear, startMonth, startDay, dayCount), calendar)
        {
            this.startDay = new DateTime(startYear, startMonth, startDay);
            this.dayCount = dayCount;
            endDay        = calendar.MapEnd(this.startDay.AddDays(dayCount));
        }         // DayTimeRange
Exemplo n.º 49
0
 /// <summary>
 /// <paramref name="moment"/>가 속한 년과 <paramref name="yearCount"/> 만큼의 기간
 /// </summary>
 public static YearRangeCollection GetYearRanges(this DateTime moment, int yearCount, ITimeCalendar timeCalendar = null) {
     return new YearRangeCollection(moment, yearCount, timeCalendar ?? TimeCalendar.New());
 }
Exemplo n.º 50
0
        } // Halfyears

        // ----------------------------------------------------------------------
        public Halfyears(DateTime moment, YearHalfyear startHalfyear, int count, ITimeCalendar calendar) :
            this(TimeTool.GetYearOf(calendar.YearBaseMonth, calendar.GetYear(moment), calendar.GetMonth(moment)),
                 startHalfyear, count, calendar)
        {
        } // Halfyears
Exemplo n.º 51
0
 /// <summary>
 /// <paramref name="moment"/>가 속한 주에서 <paramref name="weekCount"/>만큼의 주의 기간
 /// </summary>
 public static WeekRangeCollection GetWeekRanges(this DateTime moment, int weekCount, ITimeCalendar timeCalendar = null) {
     return new WeekRangeCollection(moment, weekCount, timeCalendar ?? TimeCalendar.New());
 }
Exemplo n.º 52
0
        } // Halfyears

        // ----------------------------------------------------------------------
        public Halfyears(int startYear, YearHalfyear startHalfyear, int halfyearCount, ITimeCalendar calendar) :
            base(startYear, startHalfyear, halfyearCount, calendar)
        {
        } // Halfyears
Exemplo n.º 53
0
 /// <summary>
 /// <paramref name="moment"/>가 속한 시간의 기간을 반환합니다 (1시간)
 /// </summary>
 public static HourRange GetHourRange(this DateTime moment, ITimeCalendar timeCalendar = null) {
     return new HourRange(moment, timeCalendar ?? TimeCalendar.New());
 }
Exemplo n.º 54
0
 public Month(ITimeCalendar calendar)
     : this(ClockProxy.Clock.Now, calendar)
 {
 }
Exemplo n.º 55
0
 /// <summary>
 /// <paramref name="moment"/>가 속한 분의 기간을 반환합니다 (1분)
 /// </summary>
 public static MinuteRange GetMinuteRange(this DateTime moment, ITimeCalendar timeCalendar = null) {
     return new MinuteRange(moment, timeCalendar ?? TimeCalendar.New());
 }
Exemplo n.º 56
0
 public Month(DateTime moment, ITimeCalendar calendar)
     : this(calendar.GetYear(moment), (YearMonth)calendar.GetMonth(moment), calendar)
 {
 }
Exemplo n.º 57
0
 public QuarterRange(DateTime moment, ITimeCalendar calendar) :
     this(TimeTool.GetYearOf(calendar.YearBaseMonth, calendar.GetYear(moment), calendar.GetMonth(moment)),
          TimeTool.GetQuarterOfMonth(calendar.YearBaseMonth, moment.Month),
          calendar) {}
Exemplo n.º 58
0
 public Month(int year, YearMonth yearMonth, ITimeCalendar calendar)
     : base(year, yearMonth, 1, calendar)
 {
 }
Exemplo n.º 59
0
 public QuarterRange(ITimeCalendar calendar) : this(ClockProxy.Clock.Now.Date, calendar) {}
Exemplo n.º 60
0
 // ----------------------------------------------------------------------
 protected HalfyearTimeRange(int startYear, YearHalfyear startHalfyear, int halfyearCount, ITimeCalendar calendar) :
     base(GetPeriodOf(calendar, startYear, startHalfyear, halfyearCount), calendar)
 {
     this.startYear     = startYear;
     this.startHalfyear = startHalfyear;
     this.halfyearCount = halfyearCount;
     TimeTool.AddHalfyear(startYear, startHalfyear, halfyearCount - 1, out endYear, out endHalfyear);
 }         // HalfyearTimeRange