From dc53f766c8bfc837fd43b1174558dbd5e2420bcd Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Thu, 20 Feb 2020 00:34:50 +0100 Subject: [PATCH] Fix game day for the first playoffs. --- config.js | 10 +++++----- update_sheets.js | 6 +++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/config.js b/config.js index 367dca3..96bd5b4 100644 --- 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' ], diff --git a/update_sheets.js b/update_sheets.js index a656c89..7776425 100644 --- a/update_sheets.js +++ b/update_sheets.js @@ -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. -- 2.39.2