File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,29 @@ as an option (see end_date in the example).
153153If both are specified then the moment format in options will take precedence.
154154
155155
156+ Customize DatePicker Format
157+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
158+
159+ In order to use arbitraty formats you must specify the pattern to the field's ``input_formats `` and the widget's ``format ``.
160+
161+ .. code-block :: python
162+ :emphasize- lines: 11 - 12
163+
164+ # File: forms.py
165+ from bootstrap_datepicker_plus import DatePickerInput
166+ from .models import Event
167+ from django import forms
168+
169+ class ToDoForm (forms .Form ):
170+ todo = forms.CharField(
171+ widget = forms.TextInput(attrs = {" class" : " form-control" })
172+ )
173+ date = forms.DateField(
174+ input_formats = [' %d /%m/%Y' ],
175+ widget = DatePickerInput(format = ' %d /%m/%Y' )
176+ )
177+
178+
156179 Customize the Language
157180^^^^^^^^^^^^^^^^^^^^^^^
158181
You can’t perform that action at this time.
0 commit comments