mirror of https://github.com/snachodog/mybuddy.git
Default datetime input to seconds granularity
This commit is contained in:
parent
8211cb40a8
commit
2007f998cf
|
@ -116,6 +116,13 @@ class DateTimeBaseInput(widgets.DateTimeBaseInput):
|
|||
class DateTimeInput(DateTimeBaseInput):
|
||||
input_type = "datetime-local"
|
||||
|
||||
def build_attrs(self, base_attrs, extra_attrs=None):
|
||||
attrs = super().build_attrs(base_attrs, extra_attrs)
|
||||
# Default to seconds granularity. Required for client validation in Safari.
|
||||
if "step" not in attrs:
|
||||
attrs["step"] = 1
|
||||
return attrs
|
||||
|
||||
|
||||
class DateInput(DateTimeBaseInput):
|
||||
input_type = "date"
|
||||
|
|
Loading…
Reference in New Issue