#31623: timesince 'depth' parameter
---------------------------------------+---------------------------
               Reporter:  Toby Such    |          Owner:  nobody
                   Type:  New feature  |         Status:  new
              Component:  Utilities    |        Version:  master
               Severity:  Normal       |       Keywords:  timesince
           Triage Stage:  Unreviewed   |      Has patch:  0
    Needs documentation:  0            |    Needs tests:  0
Patch needs improvement:  0            |  Easy pickings:  1
                  UI/UX:  0            |
---------------------------------------+---------------------------
 The timesince function is a bit limiting as it is right now. A `depth`
 parameter should be added to configure how many values are shown. The
 depth parameter should be defaulted to 2 as this is how the current
 implementation behaves. The existing rule of values having to be adjacent
 to one another should still remain.

 The logic for calculating the time since, before formatting should also be
 pulled out of the function and placed in its own so that custom
 implementations can be created.

 For example:
 With a depth of one it should always display as "1 week" or "3 years" etc.
 With a depth of two: "1 week, 3 days" or "3 years, 7 months"
 With a depth of three: "1 week, 3 days, 5 hours" or "3 years, 7 months, 2
 weeks"

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31623>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.8e306e84c894decb1fee5f34eba34955%40djangoproject.com.

Reply via email to