dziemborowicz/hourglass

Issues with 24-hour clock format (military time)

sircedriclex opened this issue · 4 comments

Two issues have arisen regarding the input of 24-hour format in combination with "until time of day":

  1. Using "until 00:10:30" for example is not recognized as a valid input (the hour 00 or 0 seems to be the problem).
  2. Assuming the local time is 01:15:00 am, then typing "until 02:30:00" starts a countdown of "13 hours 15 minutes and 0 seconds". It would be much more intuitive to always select the next (shorter) point in time (am or pm) after the given input and not by default only pm (i.e. starting a countdown of "1 hour 15 minutes and 0 seconds" in this case).

Maybe you can add a selectable option to generally use 24-hour format as default in combination with "until ..." if am/pm is not specified in the user input.

Thanks for the great program! I am using it on a daily basis.

I think at some point I'm just going to have to sit down and rewrite the parsing code. It tries too hard to be intuitive in edge cases, which makes it less predictable and therefore actually less intuitive for regular users.

  1. This seems like a bug that might be fixable when I'm back from holidays.

  2. That is by design, but right now I can't imagine why I thought it made sense to prefer "office hours" times even when starting the timer in the middle of the night. I think I would classify this as a bug also, and one of those "intuitive" cases that actually is not intuitive. :)

Have you had time to look into the first problem (hour 00 or 0 in combination with "until time of day")?
It would be incredible if this could possibly get fixed in the next release.
Thank you very much!

The first issue is now fixed in d715a5a.

The second issue is now fixed in 85070fc. Parsing something like until 1:15 will now be interpreted as until 1:15 am when parsed at midnight and until 1:15 pm when parsed at midday.

If you want a string to be parsed unconditionally as military time, you can suffix it with h, hrs, or hours. For example, until 01:00 hours will be interpreted as until 1:00 am regardless of the current time.