extractDateTime method

  1. @override
DateTime extractDateTime(
  1. dynamic value,
  2. String errMsg
)
override

Parses a String into DateTime. Throws FormatException if value is not a valid date string.

Implementation

@override
DateTime extractDateTime(dynamic value, String errMsg) {
  if (value is! String) {
    throw FormatException(
      "[JsonConverter] expected string for date time parsing, got ${value.runtimeType}: $errMsg",
    );
  }
  return DateTime.parse(value);
}