static int calculateDateDiff(DateTime startDate, DateTime endDate) { Duration diff = endDate.difference(startDate); return diff.inDays; }