format date using ES Format

This commit is contained in:
RubenPX 2022-03-11 17:36:51 +01:00
parent 49d49a3044
commit ed3ad7cda0

View file

@ -1,5 +1,6 @@
import logging
import smtplib
import datetime
from django.conf import settings
from django.contrib import messages
@ -181,6 +182,8 @@ class BillingView(ServiceListView):
def get_queryset(self):
qs = super().get_queryset()
qs = sorted(qs, key=lambda x: x.created_on, reverse=True)
for q in qs:
q.created_on = datetime.datetime.strptime(q.created_on, "%Y-%m-%d").strftime("%d/%m/%Y")
return qs