mirror of https://github.com/snachodog/mybuddy.git
parent
1aad600f6c
commit
858436e840
|
@ -30,9 +30,14 @@ def datetime_short(date):
|
||||||
:param date: datetime instance
|
:param date: datetime instance
|
||||||
:return: a string representation of `date`.
|
:return: a string representation of `date`.
|
||||||
"""
|
"""
|
||||||
now = timezone.now()
|
|
||||||
date_string = None
|
date_string = None
|
||||||
time_string = None
|
time_string = None
|
||||||
|
|
||||||
|
# The value received from templates will be UTC so it must be converted to
|
||||||
|
# localtime here.
|
||||||
|
date = timezone.localtime(date)
|
||||||
|
|
||||||
|
now = timezone.localtime()
|
||||||
if now.date() == date.date():
|
if now.date() == date.date():
|
||||||
date_string = _('Today')
|
date_string = _('Today')
|
||||||
time_string = formats.date_format(date, format='TIME_FORMAT')
|
time_string = formats.date_format(date, format='TIME_FORMAT')
|
||||||
|
|
Loading…
Reference in New Issue