Use Math.floor instead of parseInt to avoid problems with very small numbers like...
authorThomas Rosenau <rosenau@seitenbau.com>
Sun, 2 Jun 2013 09:02:53 +0000 (11:02 +0200)
committerThomas Rosenau <rosenau@seitenbau.com>
Sun, 2 Jun 2013 09:02:53 +0000 (11:02 +0200)
plugin/notes/notes.html

index 830045d1f13be712de84e120ff24a93193be194a..e75be28e89b7375f48ab97d9a52c332fb8df9827 100644 (file)
                                                        now = new Date();
 
                                                diff = now.getTime() - start.getTime();
-                                               hours = parseInt( diff / ( 1000 * 60 * 60 ) );
-                                               minutes = parseInt( ( diff / ( 1000 * 60 ) ) % 60 );
-                                               seconds = parseInt( ( diff / 1000 ) % 60 );
+                                               hours = Math.floor( diff / ( 1000 * 60 * 60 ) );
+                                               minutes = Math.floor( ( diff / ( 1000 * 60 ) ) % 60 );
+                                               seconds = Math.floor( ( diff / 1000 ) % 60 );
 
                                                clockEl.innerHTML = now.toLocaleTimeString();
                                                hoursEl.innerHTML = zeroPadInteger( hours );