yearStart property

DateTime get yearStart

Gets the start date of the year.

Returns: DateTime: The first day of the year.

Throws: ArgumentError: If the year is greater than 9999.

Implementation

DateTime get yearStart {
  if (year > 9999) {
    throw ArgumentError('[year] must be <= 9999');
  }

  // January 1st of the year - 1 is the default month and day
  return DateTime(year);
}