date property

DateTime get date

Converts to DateTime, using 1 for missing parts (month/day) to avoid year shift.

Returns: A DateTime instance (may be invalid if parts are null/0).

Implementation

DateTime get date {
  return DateTime(year ?? 0, month ?? 1, day ?? 1);
}