From 933eba8789f9702ff6db76c4310f7b21db14a7b9 Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Sat, 16 Apr 2016 18:11:48 +0100 Subject: [PATCH] round decreasing timers to mirror increasing timers --- plugin/notes/notes.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugin/notes/notes.html b/plugin/notes/notes.html index 15bca19..34f6073 100644 --- a/plugin/notes/notes.html +++ b/plugin/notes/notes.html @@ -464,9 +464,10 @@ secondsEl = timeEl.querySelector( '.seconds-value' ); function _displayTime( hrEl, minEl, secEl, time) { - var hours = Math.floor( time / ( 1000 * 60 * 60 ) ); - var minutes = Math.floor( ( time / ( 1000 * 60 ) ) % 60 ); - var seconds = Math.floor( ( time / 1000 ) % 60 ); + time = Math.round(time / 1000); + var seconds = time % 60; + var minutes = ( time / 60 ) % 60 ; + var hours = time / ( 60 * 60 ) ; hrEl.innerHTML = zeroPadInteger( hours ); if (hours == 0) { hrEl.classList.add( 'mute' );