Accepting AM/ PM Time Formats
|Reported by:||tclancy||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I have a form with two TimeFields. Because I want to accept "AM" and "PM, I've set the input_formats to ['%H:%M%p', '%H:%M %p', '%H:%M']. While this passes the validator, time.strftime() (as of Python 2.5 anyway) doesn't seem to differentiate between "AM" and "PM", it just lops it off and treats both as an AM value. While I realize this is an issue with the underlying Python code and that there are internationalization concerns, can the TimeField/ DateTimeField be updated to add 12 hours to any string with "PM" in it? Maybe as an optional argument to init? I'm happy to take a crack at it if this is worth pursuing.
You can see the full tale of my struggle (with code) here. Apologies if this is covered in full elsewhere or a dumb question, but I couldn't see if 1.2 fixes this.