Skip to content

Commit

Permalink
Merge pull request #2190 from caumons/datetimefield-wtforms3
Browse files Browse the repository at this point in the history
Fixed DateTimeField format compatibility with WTForms 3.0. Fixes #2189
  • Loading branch information
mrjoes authored Jan 24, 2022
2 parents 7cff9c7 + 5041018 commit 18d28e8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions flask_admin/form/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ def __init__(self, label=None, validators=None, format=None, **kwargs):
:param kwargs:
Any additional parameters
"""
super(DateTimeField, self).__init__(label, validators, **kwargs)

self.format = format or '%Y-%m-%d %H:%M:%S'
super(DateTimeField, self).__init__(
label, validators, format or '%Y-%m-%d %H:%M:%S', **kwargs)


class TimeField(fields.Field):
Expand Down

0 comments on commit 18d28e8

Please sign in to comment.