From ed3ad7cda0d588b8849aff6524036e3778f97ba0 Mon Sep 17 00:00:00 2001 From: RubenPX Date: Fri, 11 Mar 2022 17:36:51 +0100 Subject: [PATCH] format date using ES Format --- musician/views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/musician/views.py b/musician/views.py index 1bdc69b..3ab4265 100644 --- a/musician/views.py +++ b/musician/views.py @@ -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