d2FunctionsEval top-level property

Map<String, Function> d2FunctionsEval
final

Implementation

final Map<String, Function> d2FunctionsEval = {
  'd2:daysBetween': (
    String expression,
    List<String> parameters,
    Map<String, dynamic> variableHash,
    String regexFunct,
  ) {
    final date1 = removeQuotes(parameters[0]);
    final date2 = removeQuotes(parameters[1]);

    final daysBetween = DateUtils.daysBetween(date1, date2);
    final newExpression = expression.replaceFirst(regexFunct, '$daysBetween');
    return {'expression': newExpression, 'expressionUpdated': true};
  },
};