dziemborowicz/hourglass

Loop timer for Until time of day?

porea opened this issue · 5 comments

porea commented

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

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.

/// <summary>
/// Gets a value indicating whether the timer supports looping.
/// </summary>
public bool SupportsLooping
{
get { return this.TimerStart == null || this.TimerStart.Type == TimerStartType.TimeSpan; }
}

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

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.

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

porea commented

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.