Created
January 23, 2015 13:51
-
-
Save george-silva/6d13219cb23f3fa3f978 to your computer and use it in GitHub Desktop.
Templatetag to limit the output of timeuntil.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.template import Library | |
register = Library() | |
@register.filter | |
def split_timeuntil(duration, chunks=1): | |
return ", ".join(duration.split(",")[0:chunks]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment