AnnualDate constructor

AnnualDate([
  1. int month = 1,
  2. int day = 1
])

Constructs an instance for the given month and day in the ISO calendar.

  • month: The month of year.

  • day: The day of month.

  • ArgumentOutOfRangeException: The parameters do not form a valid date. (February 29th is considered valid.)

Implementation

AnnualDate([int month = 1, int day = 1])
  // See comment below for why this is using year 1, and why that's okay even for February 29th.
  : _value = YearMonthDay(1, month, day)
{
  // The year 2000 is a leap year, so this is fine for all valid dates.
  GregorianYearMonthDayCalculator.validateGregorianYearMonthDay(2000, month, day);
}