mrjoes/flask-admin — pull request #550 by pawl (2014-05-25 00:55:53+00:00)
Title: Allow Changing DateTimeField's date-format using form__widget_args

I think I have a better way to solve this. It solves the problem of not being able to change hard-coded widget kwargs in #549, but I think it's more intuitive - because it uses form_widget_args.

The following code will change date-format:
```
form_args = dict(
start=dict(format='%Y-%m-%d %H:%M')
)
form_widget_args = dict(
start={'data-date-format': u'yyyy-mm-dd hh:ii'}
)
```

The only problem above is that you still need to set the "format" for the form field. This is so it knows how to parse the string into the datetime object.

This project has a very smart way of handling the "format" field automatically (by using a mapping): https://github.com/asaglimbeni/django-datetime-widget/blob/master/datetimewidget/widgets.py#L42

However, I'm having trouble figuring out how to get the kwargs['data-date-format'] out of the widget object so the format can be set based on it.