Permalink
Browse files

fix month number

  • Loading branch information...
iloire committed Aug 23, 2012
1 parent 70afb8f commit c1e2e08a18ab224b0578db314802d4114f337408
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/modules/race.js
View
@@ -8,8 +8,8 @@ function getRandomInt (min, max) {
function Operation () {
var self = this;
var member1 = getRandomInt(0,20);
- var member2 = getRandomInt(0,20);
-
+ var member2 = getRandomInt(0,20);
+
var operation_type = getRandomInt(0,1) ? '+' : '-'; //build the match challenge.
self.quest = member1 + operation_type + member2;
self.solution = eval (self.quest);
@@ -64,11 +64,11 @@ function createRace(server){
var remaining = Math.floor((game_duration - elapsed) / 1000);
if (remaining<0){
//archive game
- var timestamp = game_started.getDate() + '/' + game_started.getMonth() + '/' + game_started.getFullYear() + ' ' + game_started.getHours() + ":" + (game_started.getMinutes() > 9 ? game_started.getMinutes() : '0' + game_started.getMinutes());
+ var timestamp = game_started.getDate() + '/' + (game_started.getMonth() + 1) + '/' + game_started.getFullYear() + ' ' + game_started.getHours() + ":" + (game_started.getMinutes() > 9 ? game_started.getMinutes() : '0' + game_started.getMinutes());
if (format_scores(scores).length){
history.push({
- timestamp: game_started.getTime(),
- name: timestamp,
+ timestamp: game_started.getTime(),
+ name: timestamp,
scores: format_scores(scores)
});

0 comments on commit c1e2e08

Please sign in to comment.