CorruptedArk / did-i-take-my-meds

A Kotlin Android app to manage medications
GNU General Public License v3.0
175 stars 15 forks source link

Thousands of days since last dose. #37

Closed Khilseith closed 2 years ago

Khilseith commented 2 years ago

Describe the bug Time since dose says 18000+ days

To Reproduce Steps to reproduce the behavior:

  1. Make a new medication
  2. Schedule dose
  3. Set the start time to some time in the past
  4. Click on new medication
  5. Time since dose is now stupid high.

Expected behavior Since no dose has ever been taken I wouldn't expect a time since last dose

Screenshots Screenshot_20211206-075914~2

Smartphone:

CorruptedArk commented 2 years ago

At the moment this is intended functionality because that time it says is when computers started counting time. It essentially means no dose taken. However, I can see why that would be confusing to a user, and I can make some changes to remove that confusion

caos30 commented 2 years ago

Hehehe, @CorruptedArk i would add to the whislist another "little format improvement". Convert this:

"Approximately 0 day(s), 11 hour(s), and 45 minute(s) since last taken dose."

to this other:

"Approximately 11 hour(s) and 45 minute(s) since last taken dose."

I know, i know (as a translator i know) that this "sentence" is a UNIQUE translatable sentence like this:

"Approximately %1$d day(s), %2$d hour(s), and %3$d minute(s) since last taken dose"

So, you cannot do many thinks as a developer. But also as a developer & translator, i recommend to you to change to a scheme like this other one:

"Approximately %1$d since last taken dose."

where %1$d will be replaced with a string built joining the "not empty units", for example in this example above:

%2$d hour(s) + %3$d minute(s)

But for this you will need these new translatable text you don't have now (example, in catalan):

day -> dia
days -> dies
hour -> hora
hours -> hores
minute -> minut
minute -> minuts

Take in account that the plural in some languages are not always simply adding an "s" character at the end, so we need a text for each singular/plural time unit.

In fact, if you make the same for "week", "month" and "year"... you could apply the same thing in "sentences" like "schedule_format"... now:

%1$sStarts %2$sRepeats every%3$d day(s), %4$d week(s),%5$d month(s), %6$d year(s)

With this improvement we would improve A LOT the visual READABILITY of these complex time sentences. Sincerely, it's the unique "ugly" (uncomfortable?) part of the UI of your app.

Man, i'm a PHP developer... it's a shame i cannot know how to help to you to implement these changes on Kotlin. Sorry, i only can suggest an abstract way to built it.

auctumnus commented 2 years ago

If a user hasn't taken a dose, the best solution is probably just to say "No dose recorded yet." rather than defaulting to the epoch. I'm not a Kotlin dev, so I can't really find where in the source this should be changed, but I assume just making the last-taken value nullable and displaying that on null should work? (... Or, if it's just a big list, if the list is empty, display that.)

(Also, it'd be better to keep discussion of better relative timekeeping to issue #28.)