#36307: Support passing depth to naturaltime, timesince and timeuntil filters
-------------------------------------+-------------------------------------
               Reporter:  Giannis    |          Owner:  Giannis Terzopoulos
  Terzopoulos                        |
                   Type:  New        |         Status:  assigned
  feature                            |
              Component:             |        Version:
  Uncategorized                      |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 I propose extending these filters to accept an optional `depth` argument
 that gets passed downstream:

 - `timesince` would pass depth to `django.utils.timesince.timesince()`
 - `timeuntil` would pass depth to `django.utils.timesince.timeuntil()`
 - `naturaltime` would pass depth to `NaturalTimeFormatter.string_for()`,
 which would then pass it to the underlying `timesince`/`timeuntil` calls

 ----

 ''Example'':
 For a datetime object `dt` representing 38 days in the past:

 `{{ dt|naturaltime:"1" }}`  would return "1 month ago", instead of the
 current depth=2 output: "1 month, 1 week ago"
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36307>
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 visit 
https://groups.google.com/d/msgid/django-updates/0107019615a6814f-19bd2cd5-c1c6-477d-b0d8-936d87c80378-000000%40eu-central-1.amazonses.com.

Reply via email to