Merge pull request #9849 from JadynWong/jadyn/exprop-mvcui-format

Make mvc ui `ExtendingPropertry` support `DisplayFormatAttribute`
pull/9872/head
maliming 4 years ago committed by GitHub
commit 3105880306
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -37,6 +37,13 @@ namespace Volo.Abp.ObjectExtending
public static string GetInputFormatOrNull(this IBasicObjectExtensionPropertyInfo property)
{
var formatString = property.GetDataFormatStringOrNull();
if (!formatString.IsNullOrWhiteSpace())
{
return formatString;
}
if (property.IsDate())
{
return "{0:yyyy-MM-dd}";

@ -33,5 +33,13 @@ namespace Volo.Abp.ObjectExtending
.OfType<DataTypeAttribute>()
.FirstOrDefault()?.DataType;
}
public static string GetDataFormatStringOrNull(this IBasicObjectExtensionPropertyInfo property)
{
return property
.Attributes
.OfType<DisplayFormatAttribute>()
.FirstOrDefault()?.DataFormatString;
}
}
}

Loading…
Cancel
Save