Is there a way to use the {{date|timesince}} filter, but instead of having two adjacent units, only display one?
For example, my template is currently displ
A quick and dirty way:
Change the django source file $PYTHON_PATH/django/utils/timesince.py @line51(django1.7) :
result = avoid_wrapping(name % count)
return result #add this line let timesince return here
if i + 1 < len(TIMESINCE_CHUNKS):
# Now get the second item
seconds2, name2 = TIMESINCE_CHUNKS[i + 1]
count2 = (since - (seconds * count)) // seconds2
if count2 != 0:
result += ugettext(', ') + avoid_wrapping(name2 % count2)
return result