mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-02-17 19:45:17 +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 """
|
""" template filters """
|
||||||
from dateutil.relativedelta import relativedelta
|
from dateutil.relativedelta import relativedelta
|
||||||
from django import template
|
from django import template
|
||||||
|
from django.conf import settings
|
||||||
from django.contrib.humanize.templatetags.humanize import naturaltime, naturalday
|
from django.contrib.humanize.templatetags.humanize import naturaltime, naturalday
|
||||||
from django.template.loader import select_template
|
from django.template.loader import select_template
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
@ -61,7 +62,7 @@ def get_published_date(date):
|
||||||
if delta.years:
|
if delta.years:
|
||||||
return naturalday(date)
|
return naturalday(date)
|
||||||
if delta.days or delta.months:
|
if delta.days or delta.months:
|
||||||
return naturalday(date, "M j")
|
return naturalday(date, settings.MONTH_DAY_FORMAT)
|
||||||
return naturaltime(date)
|
return naturaltime(date)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue