<div dir="ltr">"1.83 y/m/d ago" is unconventional but attractive<div>IMHO,</div><div>Per Funke</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 12, 2023 at 12:43 AM Johannes Zarl-Zierl <<a href="mailto:johannes@zarl-zierl.at">johannes@zarl-zierl.at</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Tobias,<br>
<br>
> - For easter 2022 (2022-04-17), I get "11 months ago"<br>
> - For easter 2021 (2021-04-04), I get "2 years ago"<br>
> - For easter 2020 (2020-04-12), I get "2 years ago"<br>
> - For easter 2019 (2019-04-21), I get "3 years ago"<br>
> <br>
> You see the problem?<br>
<br>
Just as you guessed, this stems from the initial design of that code as a <br>
means to display the age of a person. With birthdays, it totally makes sense <br>
to say "1 year old" when the person is 1 day from their second birthday. <br>
<br>
> The longer the date is in the past, the more it's not about the date being<br>
> exactly one day after the date in question or not. Easter 2019 IS four years<br>
> ago, even if the photos have been taken on April 21, and now we only have<br>
> April 9.<br>
> <br>
> [...]<br>
> <br>
> For durations that are less than e.g. 2 years ago, we should add exacter<br>
> descriptions, like "1 year and 10 months ago". But as the distance grows, we<br>
> need to be more fuzzy. Like "Ca. 2 years ago", even if we are like one<br>
> month off. We could also add some classification like "x 1/4", "x 1/2" and<br>
> "x 3/4", with proper ranges. And with added attributes like "Ca." and<br>
> "Almost". Of course, we also need the "Exact" case, for some fixed date<br>
> (like Christmas or such).<br>
<br>
I have a hard time coming up with a scheme that expresses the colloquial <br>
description that one might use. What I can say, though, is that I really don't <br>
like adding special cases for any specific dates like Christmas.<br>
<br>
A quick and easy way would be to just use floating point numbers and say things <br>
like "1.83 years ago". This would avoid loss of information while still being <br>
somewhat intuitive to grasp, and it would work the same for 1 year as for 100 <br>
years.<br>
<br>
I would implement this as follows:<br>
less than 1 month: X days ago<br>
less than 1 year: X months ago<br>
at least 1 year: X years ago <br>
, where X has two decimal places.<br>
<br>
> However, I think that the current state of how we do it is quite messy.<br>
> Looking into Utilities/DescriptionUtil.cpp, multiple class definitions and<br>
> implementations are mixed inside one cpp file, the code is really hard to<br>
> read (at least for me), and I think the classes used don't really fit for<br>
> what I would do.<br>
<br>
If one moves the relevant info from dateDifference into the AgeSpec class, we <br>
have all the necessary info there to implement this.<br>
<br>
> I'm thinking of adding one more versatile "time interval" class that either<br>
> can return an exact difference, or a fuzzy one, depending for what we want<br>
> to use it. And there's as it seems only two cases: The age of some person<br>
> in years, or a period of time that has passed since a photo has been taken.<br>
<br>
That is basically what the AgeSpec class does. The only problem with the class <br>
in its current state is that it lacks the exact time interval because the <br>
information was discarded by the dateDifference() function. But that can be <br>
remedied...<br>
<br>
Cheers,<br>
Johannes<br>
<br>
<br>
<br>
</blockquote></div>