]> git.sesse.net Git - ultimatescore/commitdiff
Fix game day for the first playoffs.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 19 Feb 2020 23:34:50 +0000 (00:34 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 19 Feb 2020 23:34:53 +0000 (00:34 +0100)
config.js
update_sheets.js

index 367dca3cc00d6fcba6f138bda0c7af55e2c82556..96bd5b4154e064490d7f6111cec0f36b701225be 100644 (file)
--- a/config.js
+++ b/config.js
@@ -42,11 +42,11 @@ var ultimateconfig = {
        'explain_third_cell': 'Results!S26',
 
        'playoff_games': [
-               // Teams                        Field   Row    Match name     Mark name    Group name
-               [ 'C5',          'A4',          0,      0,     'C5/A4',       false,       'Playoffs 9th–13th' ],
-               [ 'B4',          'C4',          1,      0,     'B4/C4',       false,       'Playoffs 9th–13th' ],
-               [ 'A4',          'B4',          0,      2,     'A4/B4',       false,       'Playoffs 9th–13th' ],
-               [ 'Z3',          'C5',          1,      2,     'Z3/C5',       false,       'Playoffs 9th–13th' ],
+               // Teams                        Field   Row    Match name     Mark name    Group name              Game day (default 7)
+               [ 'C5',          'A4',          0,      0,     'C5/A4',       false,       'Playoffs 9th–13th',    6 ],
+               [ 'B4',          'C4',          1,      0,     'B4/C4',       false,       'Playoffs 9th–13th',    6 ],
+               [ 'A4',          'B4',          0,      2,     'A4/B4',       false,       'Playoffs 9th–13th',    6 ],
+               [ 'Z3',          'C5',          1,      2,     'Z3/C5',       false,       'Playoffs 9th–13th',,   6 ],
                [ 'C4',          'Z3',          0,      8,     'C4/Z3',       false,       'Playoffs 9th–13th' ],
                [ 'C5',          'B4',          1,      8,     'C5/B4',       false,       'Playoffs 9th–13th' ],
 
index a656c89286f944211048ef070daf8ecb07fe7366..7776425146c700e58de0e2d61a32c977a2ebdddd 100644 (file)
@@ -301,6 +301,10 @@ function fill_playoff(replacements, teams) {
                        let score2 = response['values'][row - 1][cols[2]];
                        let game_name = game[4];
                        let game_name2 = game_name.replace("Semi", "semi");
+                       let game_day = game[7];
+                       if (game_day === undefined) {
+                               game_day = 7;  // Sunday.
+                       }
 
                        let range = {
                                "sheetId": ultimateconfig['score_sheet_index'],
@@ -336,7 +340,7 @@ function fill_playoff(replacements, teams) {
                                // Game.
                                updates.push({
                                        "range": "Playoffs!A" + (game_num + 32) + ":J" + (game_num + 32),
-                                       "values": [ [ team1, team2, score1, score2, "", "", "", 7, response['values'][row - 1][1].replace(".",":"), game[6] ] ]
+                                       "values": [ [ team1, team2, score1, score2, "", "", "", game_day, response['values'][row - 1][1].replace(".",":"), game[6] ] ]
                                });
 
                                // Team codes.