difference method

  1. @useResult
Duration difference(
  1. LocalDate other
)

Returns the difference between this and other.

final foo = LocalDate(2023, 4, 12);
final bar = LocalDate(2023, 4, 1);

foo.difference(bar); // 11 days

bar.difference(foo); // -11 days

Implementation

@useResult Duration difference(LocalDate other) => Duration(microseconds: epochMicroseconds - other.epochMicroseconds);