mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-17 13:45:05 +00:00
fix: XmlReaderExtensions handling both TimeSpan formats
This commit is contained in:
@@ -409,6 +409,17 @@ namespace ICD.Common.Utils.Xml
|
|||||||
throw new ArgumentNullException("extends");
|
throw new ArgumentNullException("extends");
|
||||||
|
|
||||||
string content = extends.ReadElementContentAsString();
|
string content = extends.ReadElementContentAsString();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 00:00:00 format
|
||||||
|
return TimeSpan.Parse(content);
|
||||||
|
}
|
||||||
|
catch (FormatException)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// PT0S format
|
||||||
return IcdXmlConvert.ToTimeSpan(content);
|
return IcdXmlConvert.ToTimeSpan(content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user