extractXmlDateTimeValue function

DateTime? extractXmlDateTimeValue(
  1. XmlElement elem,
  2. String name, {
  3. DateTime? parser(
    1. String
    )?,
})

Implementation

DateTime? extractXmlDateTimeValue(XmlElement elem, String name,
    {DateTime? Function(String)? parser}) {
  final str = extractXmlStringValue(elem, name);
  if (str == null) {
    return null;
  }
  if (parser != null) {
    return parser(str);
  }
  return DateTime.parse(str);
}