You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make a new AdminModelConverter which override the method convert_time to return TimeField object with formats=('%H:%M:%S', '%M:%S') and default_formatt='%M:%S'.
What I got and need help with:
A edit page with '%M:%S' format, but a list page with '%H:%M:%S' format.
A pop up daterangepicker with hour selector & minute selector instead of minute selector & second selector in the edit page which I want.
If TimeField's formats=(''%M:%S') only, it says 'Invalid time format' all the time when I press save in edit page.
Briefly speaking, I 'm try to use the
'%M:%S'
format ofTime
like 23:30.What I have done:
form_args
andform_widget_args
variable of ModelView like example here https://github.com/flask-admin/flask-admin/blob/master/flask_admin/model/base.py#L572AdminModelConverter
which override the methodconvert_time
to returnTimeField
object withformats
=('%H:%M:%S', '%M:%S') anddefault_format
t='%M:%S'.What I got and need help with:
'%M:%S'
format, but a list page with'%H:%M:%S'
format.hour selector & minute selector
instead ofminute selector & second selector
in the edit page which I want.If
TimeField
'sformats
=(''%M:%S') only, it says'Invalid time format'
all the time when I press save in edit page.And I found that the
widget_format
parameter in constructor ofTimeField
may not be used anymore.https://github.com/flask-admin/flask-admin/blob/master/flask_admin/form/fields.py#L48
The text was updated successfully, but these errors were encountered: