/** * @param daysInYear The number of days in each year */ protected FixedYearLengthChronology(int daysInYear) { this.daysInYear = daysInYear; this.yearDuration = new PreciseDurationField(DurationFieldType.years(), daysInYear * dayDuration.getUnitMillis()); this.centuryDuration = new PreciseDurationField(DurationFieldType.centuries(), 100 * yearDuration.getUnitMillis()); this.dayOfYear = new OneBasedPreciseDateTimeField(DateTimeFieldType.dayOfYear(), dayDuration, this.yearDuration); this.yearOfCentury = new PreciseDateTimeField(DateTimeFieldType.yearOfCentury(), this.yearDuration, this.centuryDuration); this.year = new YearField(this.yearDuration); }
/** * @param daysInYear * The number of days in each year */ protected FixedYearLengthChronology(int daysInYear) { this.daysInYear = daysInYear; this.yearDuration = new PreciseDurationField(DurationFieldType.years(), daysInYear * dayDuration.getUnitMillis()); this.centuryDuration = new PreciseDurationField(DurationFieldType.centuries(), 100 * yearDuration.getUnitMillis()); this.dayOfYear = new OneBasedPreciseDateTimeField(DateTimeFieldType.dayOfYear(), dayDuration, this.yearDuration); this.yearOfCentury = new PreciseDateTimeField(DateTimeFieldType.yearOfCentury(), this.yearDuration, this.centuryDuration); this.year = new YearField(this.yearDuration); }