Fix Jinja2 template error - replace moment() with server-side timestamp formatting

This commit is contained in:
Russell Ballestrini 2025-09-24 14:34:41 -04:00
parent 1cce8c679e
commit e9e6aa920b
2 changed files with 7 additions and 3 deletions

View file

@ -16,9 +16,7 @@
{{ payment.coin_name }} ({{ payment.coin_type }}) Payment
</h4>
<p style="margin: 0; color: #6c757d; font-size: 0.9em;">
{{ payment.shop_name }} •
{% set dt = moment(payment.created_timestamp / 1000) %}
{{ dt.strftime('%Y-%m-%d %H:%M:%S') }}
{{ payment.shop_name }} • {{ payment.created_formatted }}
</p>
</div>
<div style="text-align: right;">

View file

@ -808,6 +808,11 @@ def crypto_quotes_history(request):
# Determine status display info
status_info = get_payment_status_info(payment.status)
# Format timestamp for display
import datetime
created_dt = datetime.datetime.fromtimestamp(payment.created_timestamp / 1000)
created_formatted = created_dt.strftime('%Y-%m-%d %H:%M:%S')
payment_data = {
"id": str(payment.id),
"coin_type": payment.coin_type,
@ -820,6 +825,7 @@ def crypto_quotes_history(request):
"usd_total": float(payment.invoice.total) if payment.invoice else 0,
"rate_usd_per_coin": payment.rate_locked_usd_per_coin,
"created_timestamp": payment.created_timestamp,
"created_formatted": created_formatted,
"quote_expires_at": payment.quote_expires_at,
"confirmations": payment.current_confirmations or 0,
"confirmations_required": payment.confirmations_required,