Had a problem with Localization for DateTime from a UTC set date, the solution was in the DateTime.ascx, and in the DateTime_Edit.ascx, I merely had to put an override for the FieldValue.
Of course, it's best practice to mark up your EF column with [DataType(DataType.DateTime)]
Of course, it's best practice to mark up your EF column with [DataType(DataType.DateTime)]
public override object FieldValue
{
get
{
return ((DateTime)base.FieldValue).ToLocalTime();
}
set
{
base.FieldValue = ((DateTime)value).ToUniversalTime();
}
}
No comments:
Post a Comment