mirror of
https://gitee.com/dotnetchina/MiniExcel.git
synced 2024-11-29 18:38:08 +08:00
Add DateTime Nullale support
Update TypeHelper.cs Signed-off-by: Gary Jia <35099424+jiaguangli@users.noreply.github.com>
This commit is contained in:
parent
a51bfbe7c7
commit
5230c8d273
@ -122,6 +122,8 @@
|
||||
newValue = _v2;
|
||||
else if (double.TryParse(vs, NumberStyles.None, CultureInfo.InvariantCulture, out var _d))
|
||||
newValue = DateTimeHelper.FromOADate(_d);
|
||||
else if (pInfo.Nullable && string.IsNullOrWhiteSpace(vs))
|
||||
newValue = null;
|
||||
else
|
||||
throw new InvalidCastException($"{vs} can't cast to datetime");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user