difference static method

Duration difference(
  1. String firstRulesDate,
  2. String secondRulesDate
)

Implementation

static Duration difference(String firstRulesDate, String secondRulesDate) {
  try {
    final firstDate =
        DateTime.parse(firstRulesDate.replaceAll("'", "").trim());
    final secondDate =
        DateTime.parse(secondRulesDate.replaceAll("'", "").trim());
    return secondDate.difference(firstDate);
  } catch (e) {
    return Duration(days: 0, hours: 0, minutes: 0, seconds: 0);
  }
}