Django - Timeuntil Tag output abbreviation
问题 I'm using django timeuntil template tag and the output is something like 8 hours, 15 minutes . Does anyone have any idea how I can make the output to be like 8 Hr, 15 Min ? 回答1: Take a look to timesince from django source code: chunks = ( (60 * 60 * 24 * 365, ungettext_lazy('%d year', '%d years')), (60 * 60 * 24 * 30, ungettext_lazy('%d month', '%d months')), (60 * 60 * 24 * 7, ungettext_lazy('%d week', '%d weeks')), (60 * 60 * 24, ungettext_lazy('%d day', '%d days')), (60 * 60, ungettext