Skip to content

Commit

Permalink
Merge pull request #16 from derikson/topic/default-date-set-to-curren…
Browse files Browse the repository at this point in the history
…t-date

Alway set the default for new games to be the current date.
  • Loading branch information
dbsmash committed Sep 21, 2014
2 parents 84c44de + e0e7bf9 commit 38e7f41
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions app/js/controllers/recordController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 38e7f41

Please sign in to comment.