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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user