Commit 648656e5 authored by Michal Čihař's avatar Michal Čihař

Fixed week ago detection

parent 04031d97
...@@ -327,12 +327,12 @@ def naturaltime(value, now=None): ...@@ -327,12 +327,12 @@ def naturaltime(value, now=None):
) % {'count': count} ) % {'count': count}
elif delta.days >= 14: elif delta.days >= 14:
count = delta.days / 7 count = delta.days / 7
if count == 1:
return _('a week ago')
return ungettext( return ungettext(
'%(count)s week ago', '%(count)s weeks ago', count '%(count)s week ago', '%(count)s weeks ago', count
) % {'count': count} ) % {'count': count}
elif delta.days > 0: elif delta.days > 0:
if delta.days == 7:
return _('a week ago')
if delta.days == 1: if delta.days == 1:
return _('yesterday') return _('yesterday')
return ungettext( return ungettext(
...@@ -378,14 +378,14 @@ def naturaltime(value, now=None): ...@@ -378,14 +378,14 @@ def naturaltime(value, now=None):
) % {'count': count} ) % {'count': count}
elif delta.days >= 14: elif delta.days >= 14:
count = delta.days / 7 count = delta.days / 7
if count == 1:
return _('a week from now')
return ungettext( return ungettext(
'%(count)s week from now', '%(count)s weeks from now', count '%(count)s week from now', '%(count)s weeks from now', count
) % {'count': count} ) % {'count': count}
elif delta.days > 0: elif delta.days > 0:
if delta.days == 1: if delta.days == 1:
return _('tomorrow') return _('tomorrow')
if delta.days == 7:
return _('a week from now')
return ungettext( return ungettext(
'%(count)s day from now', '%(count)s days from now', delta.days '%(count)s day from now', '%(count)s days from now', delta.days
) % {'count': delta.days} ) % {'count': delta.days}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment