Fixes U4-1590 so members with a Date picker will save without errors.

Improves the saving of date values.
This commit is contained in:
Morten Christensen
2013-01-30 08:43:23 -01:00
parent 29ef529c57
commit a2a925fd7a
2 changed files with 7 additions and 2 deletions

View File

@@ -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)
{

View File

@@ -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"))
{