Commit 5e790899 authored by Serge S. Koval's avatar Serge S. Koval

Merge pull request #563 from pawl/master

Add example of 12-hour time to documentation and fix formatting mistake
parents 95e04390 31459e55
......@@ -366,13 +366,13 @@ class BaseModelView(BaseView, ActionsMixin):
}
}
Note, changing the format of a DateTimeField will require changes to both form_widget_args and form_args:
Note, changing the format of a DateTimeField will require changes to both form_widget_args and form_args::
form_args = dict(
start=dict(format='%Y-%m-%d %H:%M') # changes how the input is parsed by strptime
start=dict(format='%Y-%m-%d %I:%M %p') # changes how the input is parsed by strptime (12 hour time)
)
form_widget_args = dict(
start={'data-date-format': u'yyyy-mm-dd hh:ii'} # changes how the DateTimeField displays the time
start={'data-date-format': u'yyyy-mm-dd HH:ii P', 'data-show-meridian': 'True'} # changes how the DateTimeField displays the time
)
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment