dziemborowicz / hourglass

The simple countdown timer for Windows.
MIT License
631 stars 112 forks source link

Loop timer for Until time of day? #197

Open porea opened 3 years ago

porea commented 3 years ago

hello

I found this software today which is really awesome. I am expecting a tool to countdown the everyday time until time of day 12AM, but the loop timer option cannot be enabled in this mode.

image

dziemborowicz commented 3 years ago

Yeah. Currently we resolve the end time of the timers like this to a specific date and time when they are started, so we can't loop them after that (since the end time will always be in the past after the first loop ends). But, of course, it doesn't have to work this way...

I think we currently preserve the information about how you entered the end time when you start the timer (i.e., whether you only specified the time vs. specifying the whole date) in a TimerStart object. We could make that object smarter about what timers can be looped. Currently any timer that is not a "duration"/TimeSpan timer is hardcoded to not support looping.

https://github.com/dziemborowicz/hourglass/blob/f17dc055a5e3a62bd28c25487ea1e439597e1212/Hourglass/Timing/Timer.cs#L191-L197

dziemborowicz commented 3 years ago

In the interim, you could manually create a saved timer in the settings XML that has a start date today at midnight and ends after 24 hours and loops, which would have approximately the same effect (but would stop working around daylight saving time transitions etc.). A hack for sure, but...

porea commented 3 years ago

Emm... if I reboot the machine or restart the app, I could manually re-activate the countdown with no problem but the progress (bar) will be reset, it would be awesome to automatically restore the one-day progress from 12AM to the next-day 12AM.

dziemborowicz commented 3 years ago

If you select the timer from the "Saved timers" list, the start time and progress should be preserved, I though...

porea commented 3 years ago

Ah it seems working when manually close-and-restart the app, whilst directly restart the machine seems not working, no records in the saved timers.