From e0e7bf999f054cdb25e2c1b8a03e3044bc3fa340 Mon Sep 17 00:00:00 2001 From: Dan Erikson Date: Thu, 18 Sep 2014 10:50:03 -0600 Subject: [PATCH] Alway set the default for new games to be the current date. --- app/js/controllers/recordController.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/js/controllers/recordController.js b/app/js/controllers/recordController.js index b5cb493..8479f66 100644 --- a/app/js/controllers/recordController.js +++ b/app/js/controllers/recordController.js @@ -7,10 +7,9 @@ var RecordController = function($scope, GameService, FactionService) { $scope.newGame.player_warcaster = FactionService.getCastersForFaction($scope.newGame.player_faction).filter(function(f) { return f.name == mostRecentGame.player_warcaster })[0]; - $scope.newGame.size = mostRecentGame.size; - $scope.newGame.date = mostRecentGame.date; - $scope.newGame.game_type = mostRecentGame.game_type; - $scope.newGame.location = mostRecentGame.location; + $scope.newGame.size = mostRecentGame.size; + $scope.newGame.game_type = mostRecentGame.game_type; + $scope.newGame.location = mostRecentGame.location; } resetValues(); }); @@ -53,15 +52,15 @@ var RecordController = function($scope, GameService, FactionService) { $scope.newGame = $scope.newGame || { player_faction: $scope.playerFactions[0], size: '', - date: new Date().toISOString().split('T')[0], game_type: '', location: '' }; - $scope.newGame.opponent_name = ''; - $scope.newGame.result = $scope.results[0]; + $scope.newGame.opponent_name = ''; + $scope.newGame.result = $scope.results[0]; $scope.newGame.opponent_faction = $scope.playerFactions[0]; - $scope.newGame.key = 'NEW'; + $scope.newGame.key = 'NEW'; + $scope.newGame.date = new Date().toISOString().split('T')[0], $scope.playerCasters = FactionService.getCastersForFaction($scope.newGame.player_faction); if($scope.playerCasters.indexOf($scope.newGame.player_warcaster) == -1)