addDays method

  1. @useResult
DateTime addDays(
  1. int days
)

Adds the specified number of days to the current DateTime.

Args: days (int): The number of days to add.

Returns: DateTime: A new DateTime object with the added days.

Implementation

@useResult
DateTime addDays(int days) {
  if (days == 0) {
    return this;
  }

  return Jiffy.parseFromDateTime(this).add(days: days).dateTime;
}