mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +00:00
Synchronize cart countdown with server time
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
<link rel="icon" href="{% static "pretixbase/img/favicon.ico" %}">
|
||||
{% block custom_header %}{% endblock %}
|
||||
</head>
|
||||
<body data-locale="{{ request.LANGUAGE_CODE }}">
|
||||
<body data-locale="{{ request.LANGUAGE_CODE }}" data-now="{% now "U.u" %}">
|
||||
{% block above %}
|
||||
{% endblock %}
|
||||
<div class="container">
|
||||
|
||||
@@ -133,8 +133,9 @@ class CartMixin:
|
||||
|
||||
try:
|
||||
first_expiry = min(p.expires for p in positions) if positions else now()
|
||||
minutes_left = max(first_expiry - now(), timedelta()).seconds // 60
|
||||
seconds_left = max(first_expiry - now(), timedelta()).seconds % 60
|
||||
total_seconds_left = max(first_expiry - now(), timedelta()).total_seconds()
|
||||
minutes_left = total_seconds_left // 60
|
||||
seconds_left = total_seconds_left % 60
|
||||
except AttributeError:
|
||||
first_expiry = None
|
||||
minutes_left = None
|
||||
|
||||
Reference in New Issue
Block a user