So I wont to create a timer that counts down to certain hours.
For example; I might have 6 timers running simultaneously, each counting down to a specific hour ( 1st counts down to 12.00pm, second to 1.00pm, third to 2.00pm etc. ).
I've been able to do create an hourly countdown but this would only work for a single timer and I cant figure out how to go further than an hour...
Here is my current code which is executed every second by setInterval:
time = new Date
mins = do time.getMinutes
mins = ( 59 - mins ) % 60
secs = do time.getSeconds
if secs != 60
secs = ( 59 - secs ) % 60
else
secs = 0
time = [ Number( mins ), Number( secs ) ]
minutes = time[1]
seconds = time[2]
minutes = '0' + time[1] if time[1] < 10
seconds = '0' + time[2] if time[2] < 10
console.log minutes, seconds
Any help would be appreciated.
Thanks : )