From 9f0e66e4a18dad3fe207baa79198e2cee7752923 Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Tue, 14 May 2019 16:16:22 -0400 Subject: [PATCH] fix: XmlReaderExtensions handling both TimeSpan formats --- ICD.Common.Utils/Xml/XmlReaderExtensions.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ICD.Common.Utils/Xml/XmlReaderExtensions.cs b/ICD.Common.Utils/Xml/XmlReaderExtensions.cs index ddfa023..d5dd184 100644 --- a/ICD.Common.Utils/Xml/XmlReaderExtensions.cs +++ b/ICD.Common.Utils/Xml/XmlReaderExtensions.cs @@ -409,6 +409,17 @@ namespace ICD.Common.Utils.Xml throw new ArgumentNullException("extends"); string content = extends.ReadElementContentAsString(); + + try + { + // 00:00:00 format + return TimeSpan.Parse(content); + } + catch (FormatException) + { + } + + // PT0S format return IcdXmlConvert.ToTimeSpan(content); }