add method
Modifies the year, month and day by adding to their values.
The years
, months
and days
are added to
the year, month and day of the current date,
then normalized to a valid calendar date.
The added values can be negative.
Doing date.add(years: y, months: m, days: d)
is qquivalent
to Date(date.year + y, date.month + m, date.day + d)
.
Implementation
Date add({int years = 0, int months = 0, int days = 0}) => Date(year + years, month + months, day + days);