addYears method

  1. @override
Jalali addYears(
  1. int years
)
override

Makes a new date object with added years to this date

Original date object remains unchanged

This method is safe

Implementation

@override
Jalali addYears(int years) {
  if (years == 0) {
    return this;
  } else {
    return Jalali(
      year + years,
      month,
      day,
      hour,
      minute,
      second,
      millisecond,
    );
  }
}