Reformat using black
This commit is contained in:
parent
efee4ad081
commit
a87fb49918
221 changed files with 19127 additions and 7310 deletions
|
@ -5,14 +5,14 @@ from . import registry
|
|||
|
||||
|
||||
@registry.filter
|
||||
def timedelta(value, display='long'):
|
||||
def timedelta(value, display="long"):
|
||||
if value is None:
|
||||
return value
|
||||
return nice_repr(value, display)
|
||||
|
||||
|
||||
@registry.filter
|
||||
def timestampdelta(value, display='long'):
|
||||
def timestampdelta(value, display="long"):
|
||||
value = datetime.timedelta(seconds=value)
|
||||
return timedelta(value, display)
|
||||
|
||||
|
@ -23,8 +23,8 @@ def seconds(timedelta):
|
|||
|
||||
|
||||
@registry.filter
|
||||
@registry.render_with('time-remaining-fragment.html')
|
||||
@registry.render_with("time-remaining-fragment.html")
|
||||
def as_countdown(time):
|
||||
time_now = datetime.datetime.now(datetime.timezone.utc)
|
||||
initial = abs(time - time_now)
|
||||
return {'countdown': time, 'initial': initial}
|
||||
return {"countdown": time, "initial": initial}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue