aboutsummaryrefslogtreecommitdiff
path: root/plugin/notes/notes.html
diff options
context:
space:
mode:
authorThomas Rosenau <rosenau@seitenbau.com>2013-06-02 11:02:53 +0200
committerThomas Rosenau <rosenau@seitenbau.com>2013-06-02 11:02:53 +0200
commit28d370f2aff34806f3c2d91bff06bf8f72c4b8ac (patch)
tree9d60d093a9b4e4a43199c106d612a2c051701c9c /plugin/notes/notes.html
parent396d531770849dbcb37c00258fc33da3ba25d6c1 (diff)
downloadfreenode-live-2017-presentation-28d370f2aff34806f3c2d91bff06bf8f72c4b8ac.tar
freenode-live-2017-presentation-28d370f2aff34806f3c2d91bff06bf8f72c4b8ac.tar.gz
Use Math.floor instead of parseInt to avoid problems with very small numbers like 2e-10
Diffstat (limited to 'plugin/notes/notes.html')
-rw-r--r--plugin/notes/notes.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugin/notes/notes.html b/plugin/notes/notes.html
index 830045d..e75be28 100644
--- a/plugin/notes/notes.html
+++ b/plugin/notes/notes.html
@@ -212,9 +212,9 @@
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 );