Ver código fonte

Prettify dates in dashboard report descriptions

master
dfirst 7 anos atrás
pai
commit
bcd3a8e19d
1 arquivos alterados com 4 adições e 3 exclusões
  1. 4
    3
      src/oscar/apps/dashboard/reports/reports.py

+ 4
- 3
src/oscar/apps/dashboard/reports/reports.py Ver arquivo

@@ -1,7 +1,8 @@
1 1
 from datetime import datetime, time
2 2
 
3
-from django.http import HttpResponse
4 3
 from django.utils import timezone
4
+from django.http import HttpResponse
5
+from django.template.defaultfilters import date
5 6
 from django.utils.translation import gettext_lazy as _
6 7
 
7 8
 from oscar.core import utils
@@ -29,8 +30,8 @@ class ReportGenerator(object):
29 30
     def report_description(self):
30 31
         return _('%(report_filter)s between %(start_date)s and %(end_date)s') \
31 32
             % {'report_filter': self.description,
32
-               'start_date': self.start_date,
33
-               'end_date': self.end_date,
33
+               'start_date': date(self.start_date, 'DATE_FORMAT'),
34
+               'end_date': date(self.end_date, 'DATE_FORMAT')
34 35
                }
35 36
 
36 37
     def generate(self):

Carregando…
Cancelar
Salvar