daveaglick / FluentBootstrap

Provides extensions, helper classes, model binding, and other goodies to help you use the Bootstrap CSS framework from .NET code.
http://www.fluentbootstrap.com
MIT License
200 stars 76 forks source link

InputFor does not support DisplayFormat #48

Closed frankvaneykelen closed 8 years ago

frankvaneykelen commented 8 years ago

I have this attribute on my model:

[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]

To make this work for InputFor in FluentBootstrap.Mvc v 3.3.5.1 I had to add/change the next two lines in public static ComponentBuilder<MvcBootstrapConfig<TModel>, Input> InputFor<TComponent, TModel, TValue>() in FluentBootstrap.Mvc\Forms\MvcFormExtensions.cs:

string valueFormat = metadata.EditFormatString;
return helper.Input(name, label, metadata.Model, valueFormat, inputType);
daveaglick commented 8 years ago

Thanks for the feedback. Change made in develop - hopefully getting a release to NuGet out today.

frankvaneykelen commented 8 years ago

Great, thanks!