Esempio n. 1
0
 private CalendarSystem(string id, string name, YearMonthDayCalculator yearMonthDayCalculator, int minDaysInFirstWeek)
 {
     this.id   = id;
     this.name = name;
     this.yearMonthDayCalculator = yearMonthDayCalculator;
     this.weekYearCalculator     = new WeekYearCalculator(yearMonthDayCalculator, minDaysInFirstWeek);
     this.minYear      = yearMonthDayCalculator.MinYear;
     this.maxYear      = yearMonthDayCalculator.MaxYear;
     this.minTicks     = yearMonthDayCalculator.GetStartOfYearInTicks(minYear);
     this.maxTicks     = yearMonthDayCalculator.GetStartOfYearInTicks(maxYear + 1) - 1;
     this.eras         = new ReadOnlyCollection <Era>(yearMonthDayCalculator.Eras);
     this.periodFields = new PeriodFieldSet.Builder(TimeOfDayCalculator.TimeFields)
     {
         Days   = FixedDurationPeriodField.Days,
         Weeks  = FixedDurationPeriodField.Weeks,
         Months = new MonthsPeriodField(yearMonthDayCalculator),
         Years  = new YearsPeriodField(yearMonthDayCalculator)
     }.Build();
 }