Got the Date and Date/Time new property editors created, fixed up a few date casting issues with data. These editors 'should' be compatible with the previous legacy date/datetime editors, just need to test it.

This commit is contained in:
Shannon
2013-08-14 20:08:45 +10:00
parent 3e675ff2cc
commit 4a8026c902
13 changed files with 118 additions and 31 deletions

View File

@@ -64,8 +64,15 @@ namespace Umbraco.Core.Models
}
else
{
var dt = (DateTime)property.Value;
xmlNode.AppendChild(xd.CreateTextNode(dt.ToXmlString<DateTime>()));
var date = property.Value.TryConvertTo<DateTime?>();
if (date.Success == false || date.Result == null)
{
xmlNode.AppendChild(xd.CreateTextNode(string.Empty));
}
else
{
xmlNode.AppendChild(xd.CreateTextNode(date.Result.ToXmlString<DateTime>()));
}
}
break;
default: