Поправил метод расширения

This commit is contained in:
parent 92a909a029
commit 5d865457ec

View File

@ -168,7 +168,10 @@ internal static class XLExtentions
if (typeof(T) != typeof(DateTime))
return (T)Convert.ChangeType(cell.GetFormattedString(), typeof(T), CultureInfo.InvariantCulture);
return (T)(object)DateTime.FromOADate((double)cell.Value);
if (cell.Value is DateTime dateTime)
return (T)(object)dateTime;
return (T)(object)DateTime.FromOADate((double)cell.Value);
}
catch
{