yearStart property
Gets the start date of the year.
Returns: DateTime: The first day of the year.
Throws: ArgumentError: If the year is greater than 9999. Audited: 2026-06-12 11:26 EDT
Implementation
@useResult
DateTime get yearStart {
if (year > DateConstants.maxYear) {
throw ArgumentError(_yearExceedsMaxMessage);
}
// ignore: saropa_lints/avoid_datetime_constructor, saropa_lints/avoid_datetime_constructor_unvalidated -- year from this valid DateTime and checked <= maxYear above; month and day default to 1
return DateTime(year);
}