Hi,

On Sat, May 23, 2020 at 12:39 AM Toby Such <[email protected]> wrote:

> Hi all!
>
> I've been a little frustrated with the timesince filter that comes with
> default Django. By default it always comes with 2 parts e.g. 4 hours and 3
> minutes ago but I would much rather have just the 4 hours. In my own
> projects I've simply created my own version of the timesince filter and 
> accompanying
> utils function that powers it that just has the code which adds the second
> part removed. However I wonder why this isn't standard as I can't think of
> a single website that displays time since as multiple parts.
>
> I'm proposing adding a 'depth' parameter to the timesince function which
> would allow the developer to set how many parts to render. At depth one it
> would be "3 weeks". 2 depth: "3 weeks 2 days" (default behaviour), 3 depth:
> "3 weeks, 2 days, 4 hours ago" etc.
>
>
Actually I think it's a good idea. I don't think I ever used this feature
with Django, but it's nice to have anyway.

Have you seen this question from 2011?
https://stackoverflow.com/questions/6481788/format-of-timesince-filter

Also, other related questions from
https://www.google.com/search?q=timesince+filter

אורי

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" 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-developers/CABD5YeGU2_2Bj2F%3DPW-KZVCg-2jSr1TVi9gi%3DWD3MZgjK50syw%40mail.gmail.com.

Reply via email to