mirror of https://github.com/snachodog/mybuddy.git
Revert timesince chunks after monkey patch (fixes #181)
This commit is contained in:
parent
b5086decd8
commit
b009a0bebc
|
@ -6,13 +6,16 @@ from django.utils.translation import ngettext
|
||||||
def child_age_string(duration):
|
def child_age_string(duration):
|
||||||
"""Monkey patch timesince function to day precision only.
|
"""Monkey patch timesince function to day precision only.
|
||||||
"""
|
"""
|
||||||
|
default_timesine_chunks = timesince.TIMESINCE_CHUNKS
|
||||||
timesince.TIMESINCE_CHUNKS = (
|
timesince.TIMESINCE_CHUNKS = (
|
||||||
(60 * 60 * 24 * 365, 'year'),
|
(60 * 60 * 24 * 365, 'year'),
|
||||||
(60 * 60 * 24 * 30, 'month'),
|
(60 * 60 * 24 * 30, 'month'),
|
||||||
(60 * 60 * 24 * 7, 'week'),
|
(60 * 60 * 24 * 7, 'week'),
|
||||||
(60 * 60 * 24, 'day'),
|
(60 * 60 * 24, 'day'),
|
||||||
)
|
)
|
||||||
return timesince.timesince(duration)
|
ts = timesince.timesince(duration)
|
||||||
|
timesince.TIMESINCE_CHUNKS = default_timesine_chunks
|
||||||
|
return ts
|
||||||
|
|
||||||
|
|
||||||
def duration_string(duration, precision='s'):
|
def duration_string(duration, precision='s'):
|
||||||
|
|
Loading…
Reference in New Issue