minutesBetween function

int minutesBetween(
  1. DateTime from,
  2. DateTime to
)

Returns the number of minutes between date from and to.

Implementation

int minutesBetween(DateTime from, DateTime to) {
  from = DateTime(from.year, from.month, from.day, from.hour, from.minute);
  to = DateTime(to.year, to.month, to.day, to.hour, to.month);

  return (to.difference(from).inMinutes).round();
}