mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-28 12:31:12 +00:00
enable localised dates
This commit is contained in:
parent
a61ca162b0
commit
dd45823790
1 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
""" template filters """
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from django import template
|
||||
from django.conf import settings
|
||||
from django.contrib.humanize.templatetags.humanize import naturaltime, naturalday
|
||||
from django.template.loader import select_template
|
||||
from django.utils import timezone
|
||||
|
@ -61,7 +62,7 @@ def get_published_date(date):
|
|||
if delta.years:
|
||||
return naturalday(date)
|
||||
if delta.days or delta.months:
|
||||
return naturalday(date, "M j")
|
||||
return naturalday(date, settings.MONTH_DAY_FORMAT)
|
||||
return naturaltime(date)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue