mirror of
https://github.com/django/django.git
synced 2025-07-22 20:55:17 +00:00
Fixed #22502 -- Fixed microseconds/default/form interaction
Made explicit lack of microsecond handling by built-in datetime form fields. Used that explicitness to appropriately nix microsecond values in bound fields. Thanks Claude Paroz for the review.
This commit is contained in:
parent
35e1b1efab
commit
a5de0df58b
4 changed files with 35 additions and 3 deletions
|
@ -419,6 +419,7 @@ class Textarea(Widget):
|
|||
|
||||
class DateTimeBaseInput(TextInput):
|
||||
format_key = ''
|
||||
supports_microseconds = False
|
||||
|
||||
def __init__(self, attrs=None, format=None):
|
||||
super(DateTimeBaseInput, self).__init__(attrs)
|
||||
|
@ -846,6 +847,7 @@ class SplitDateTimeWidget(MultiWidget):
|
|||
"""
|
||||
A Widget that splits datetime input into two <input type="text"> boxes.
|
||||
"""
|
||||
supports_microseconds = False
|
||||
|
||||
def __init__(self, attrs=None, date_format=None, time_format=None):
|
||||
widgets = (DateInput(attrs=attrs, format=date_format),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue