From bbac2f4660da16972bdd5d3b9bf9dbe19aafb99b Mon Sep 17 00:00:00 2001 From: s2 Date: Sat, 6 Apr 2013 10:33:08 +0200 Subject: [PATCH] removed moment.js dependency --- app/index.html | 1 - app/js/index.js | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/index.html b/app/index.html index 5d980a1..5bea538 100644 --- a/app/index.html +++ b/app/index.html @@ -12,7 +12,6 @@ - diff --git a/app/js/index.js b/app/js/index.js index 10d6ca5..ebf648d 100644 --- a/app/js/index.js +++ b/app/js/index.js @@ -64,20 +64,20 @@ if (typeof(sw) == 'undefined') { var playforwords = 10; sw.correctWords = 0; sw.wrongWords = 0; - sw.time = moment(); + sw.time = Math.round((new Date()).getTime() / 1000); sw.gameover = false; var updateBadges = function() { $('.num-of-words-wrong').html(sw.wrongWords + (sw.wrongWords == 1 ? ' word' : ' words')); $('.num-of-words').html(sw.correctWords + (sw.correctWords == 1 ? ' word' : ' words')); - $('.time-words').html(moment.duration(moment() - sw.time).seconds()); + $('.time-words').html(Math.round((new Date()).getTime() / 1000) - sw.time); if(playforwords > sw.correctWords + sw.wrongWords) { setTimeout(function() { updateBadges(); }, 100); } else { - sw.finaltime = moment.duration(moment() - sw.time).seconds(); + sw.finaltime = Math.round((new Date()).getTime() / 1000) - sw.time; sw.gameover = true; } };