mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
fix: XmlReaderExtensions handling both TimeSpan formats
This commit is contained in:
parent
4c93515f83
commit
9f0e66e4a1
1 changed files with 11 additions and 0 deletions
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue