Looks like other people seemed to have the same idea as me for a little 
fix, seems to me like it should be part of core Django. And yes I do admit 
its a small thing but if it was actually useful some more people might use 
it? 

On Friday, 22 May 2020 23:21:16 UTC+1, Uri wrote:
>
> Hi,
>
> On Sat, May 23, 2020 at 12:39 AM Toby Such <[email protected] 
> <javascript:>> 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/75977497-708d-4292-bdce-ea29ec668f65%40googlegroups.com.

Reply via email to