plus<T> static method

FhirDateTimeBase plus<T>(
  1. FhirDateTimeBase fhirDateTimeBase,
  2. ExtendedDuration o
)

Implementation

static FhirDateTimeBase plus<T>(
    FhirDateTimeBase fhirDateTimeBase, ExtendedDuration o) {
  // Adjust years and months first
  final DateTime dateTime = DateTime(
    fhirDateTimeBase.year + o.years,
    fhirDateTimeBase.month + o.months,
    fhirDateTimeBase.day + o.days,
    fhirDateTimeBase.hour + o.hours,
    fhirDateTimeBase.minute + o.minutes,
    fhirDateTimeBase.second + o.seconds,
    fhirDateTimeBase.millisecond + o.milliseconds,
    fhirDateTimeBase.microsecond + o.microseconds,
  );

  return fromMathUnits<T>(dateTime, fhirDateTimeBase);
}