#296: Localised the datetime in PDF header
This commit is contained in:
parent
71eb529adf
commit
e338529865
@ -20,6 +20,7 @@ from reportlab.pdfbase.ttfonts import TTFont
|
|||||||
from reportlab.rl_config import defaultPageSize
|
from reportlab.rl_config import defaultPageSize
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from django.utils import formats
|
||||||
# Import gettext for python 2.5 support
|
# Import gettext for python 2.5 support
|
||||||
from django.utils.translation import ugettext as _, gettext
|
from django.utils.translation import ugettext as _, gettext
|
||||||
|
|
||||||
@ -222,8 +223,8 @@ def firstPage(canvas, doc):
|
|||||||
|
|
||||||
# time
|
# time
|
||||||
canvas.setFont('Ubuntu', 7)
|
canvas.setFont('Ubuntu', 7)
|
||||||
time = datetime.now().strftime(gettext("%Y-%m-%d %H:%Mh"))
|
time = formats.date_format(datetime.now(), 'DATETIME_FORMAT')
|
||||||
canvas.drawString(15 * cm, 28 * cm, _("Printed: %s") % time)
|
canvas.drawString(15 * cm, 28 * cm, _("As of: %s") % time)
|
||||||
|
|
||||||
# title
|
# title
|
||||||
if doc.title:
|
if doc.title:
|
||||||
|
Loading…
Reference in New Issue
Block a user