Date.roll

Date roll(string units)(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) if (units == "years") @safe pure nothrow @nogc ref

Adds the given number of years or months to this Date, mutating it. A negative number will subtract.

The difference between rolling and adding is that rolling does not affect larger units. Rolling a Date 12 months gets the exact same Date. However, the days can still be affected due to the differing number of days in each month.

Because there are no units larger than years, there is no difference between adding and rolling years.

Parameters

unitsThe type of units to add ("years" or "months").
valueThe number of months or years to add to this Date.
allowOverflowWhether the day should be allowed to overflow, causing the month to increment.

Returns

A reference to the Date (this).
Date roll(string units)(long months, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) if (units == "months") @safe pure nothrow @nogc ref
No documentation available for this declaration.
Date roll(string units)(long days) if (units == "days") ref @safe pure nothrow @nogc

Adds the given number of units to this Date, mutating it. A negative number will subtract.

The difference between rolling and adding is that rolling does not affect larger units. For instance, rolling a Date one year's worth of days gets the exact same Date.

The only accepted units are "days".

Parameters

unitsThe units to add. Must be "days".
daysThe number of days to add to this Date.

Returns

A reference to the Date (this).