set input to AM PM in django timefield -
I currently want to be able to choose between user and middle of my Djangogo Timefield
If I enter:
11:00 AM
, I get a form error: "Enter valid time."
If I enter:
11:00
The form is valid with no problem.
I also tried:
Class Meta: Model = Notification Paragraph = ('Reminder',)The input format changes as follows:
11:00:00
and still gives me the verification error above
What am I doing wrong?
Use the following to get you a 12 hour format:
For input (This format is a list of Django formats used in verification):
field = TimeField (Input_formats = ('% I:% M% p', ...,. ..))
for output (this format will be used to display Django time values):
field = TimeField (widget = TimeInput (format = '% I:% M% p'))
% I a 12 hour clock format Indicates while% H indicates 24 hour clock format.
Additionally, the default list of input_forums can be found in each locale. The Formats.py file uses Django, the first field as the default output format for the time field for the input field.
Comments
Post a Comment