Fixes U4-1590 so members with a Date picker will save without errors.
Improves the saving of date values.
This commit is contained in:
@@ -78,7 +78,9 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
}
|
||||
else if (property.DataTypeDatabaseType == DataTypeDatabaseType.Date && property.Value != null && string.IsNullOrWhiteSpace(property.Value.ToString()) == false)
|
||||
{
|
||||
dto.Date = DateTime.Parse(property.Value.ToString());
|
||||
DateTime date;
|
||||
if(DateTime.TryParse(property.Value.ToString(), out date))
|
||||
dto.Date = date;
|
||||
}
|
||||
else if (property.DataTypeDatabaseType == DataTypeDatabaseType.Ntext && property.Value != null)
|
||||
{
|
||||
|
||||
@@ -598,7 +598,10 @@ namespace umbraco.cms.businesslogic.member
|
||||
}
|
||||
else if (dbType.Equals("Date"))
|
||||
{
|
||||
poco.Date = DateTime.Parse(property.Value.ToString());
|
||||
DateTime date;
|
||||
|
||||
if(DateTime.TryParse(property.Value.ToString(), out date))
|
||||
poco.Date = date;
|
||||
}
|
||||
else if (dbType.Equals("Nvarchar"))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user