Re: timesince 'depth' parameter

2020-05-23 Thread Claude Paroz
Le samedi 23 mai 2020 16:41:04 UTC+2, Toby Such a écrit : > > Maybe the logic for calculating the time before formatting could be taken > out of the function? That way it would be far easier to implement your own > custom versions of the function without copying and pasting, and makes the >

Re: timesince 'depth' parameter

2020-05-23 Thread Toby Such
I see your point but its tricky to know where you draw the line. Where do months stand? That answer will change depending on the project requirements. I wonder if there is a way of changing how the "time_strings" parameter works to control the depth more granularly but this does put a higher

Re: timesince 'depth' parameter

2020-05-23 Thread Mark Bailey
+1 There are lots of subtleties for how it can behave, and I have written my own when I want specific behaviour. Other times I want something quick, and I've used timesince, and usually just put up with the fact that it's a bit longer than I want. Having that control would make it a lot more

Re: timesince 'depth' parameter

2020-05-23 Thread Matthias Kestenholz
The same could be said for "1 day, 23 hours" vs "1 day". The way I implemented it in a former project was to only switch to days after 48 hours, and/or only switch to years after 24 months etc. Best regards, Matthias On Sat, May 23, 2020 at 12:00 PM Tom Forbes wrote: > I like this idea.

Re: timesince 'depth' parameter

2020-05-23 Thread Tom Forbes
I like this idea. However while `depth=1` makes sense for shorter time periods where the difference between `4 hours` and `4 hours and 3 minutes ago` is not required to be displayed, when you get a value that is over a year ago it loses a lot of granularity. The difference between `1 year` and

Re: timesince 'depth' parameter

2020-05-23 Thread Adam Johnson
+1 I belive I’ve copy-paste-modified timesince in a past project to implement “depth=1” On Sat, 23 May 2020 at 10:04, Tobias Kunze wrote: > On 20-05-22 19:02:02, Toby Such wrote: > >Looks like other people seemed to have the same idea as me for a little > >fix, seems to me like it should be

Re: timesince 'depth' parameter

2020-05-23 Thread Tobias Kunze
On 20-05-22 19:02:02, Toby Such wrote: >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? Sounds good to me,

Re: timesince 'depth' parameter

2020-05-22 Thread Toby Such
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

Re: timesince 'depth' parameter

2020-05-22 Thread אורי
Hi, On Sat, May 23, 2020 at 12:39 AM Toby Such 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 >

timesince 'depth' parameter

2020-05-22 Thread Toby Such
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