示例#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.GetYearTicks(minYear);
     this.maxTicks     = yearMonthDayCalculator.GetYearTicksSafe(maxYear + 1) - 1;
     this.eras         = new ReadOnlyCollection <Era>(new List <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();
 }