daysUntil method

int daysUntil(
  1. DateTime other
)

Returns the number of days between this date and other.

Example:

DateTime(2024, 1, 15).daysUntil(DateTime(2024, 1, 20)); // 5

Implementation

int daysUntil(DateTime other) {
  return other.difference(this).inDays;
}