minusPeriod method

  1. @override
LocalDateTime minusPeriod(
  1. Period amount
)

Subtracts a Period of time.

This acts on the date parts in exactly the same way as LocalDate.plusPeriod() and leaves the time untouched.

var d = LocalDateTime(2000);
d.plusPeriod(Period(days: 1)) == LocalDateTime(2000, 1, 2);

Implementation

@override
LocalDateTime minusPeriod(Period amount) =>
    LocalDateTime.combine(date.minusPeriod(amount), time);