From 7937ac4d65d04f9420644586022d8dfe3d343d65 Mon Sep 17 00:00:00 2001 From: jzitnik-dev Date: Mon, 9 Feb 2026 16:04:13 +0100 Subject: [PATCH] fix: Some minor changes --- scrape/parse/v3.js | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/scrape/parse/v3.js b/scrape/parse/v3.js index 4ff6aa7..5f00779 100644 --- a/scrape/parse/v3.js +++ b/scrape/parse/v3.js @@ -202,18 +202,10 @@ function extractTakesPlace(sheet) { if (!cell.isMerged) { return ""; } - let str = cell.master?.value?.trim() || ""; + let str = ""; - let i = 5; + let i = 4; while (true) { - const nextCell = sheet.getCell(`B${i}`); - - if (nextCell.isMerged) { - str += `\n${cell.master?.value?.trim() || ""}` - i++; - continue; - } - const tryCells = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K"]; const threshold = 20; let con = false; @@ -224,13 +216,13 @@ function extractTakesPlace(sheet) { if (cellValue.length >= threshold) { str += `\n${cellValue}`; - i++; con = true; break; } } - if (con) { + if (con || i == 4) { + i++; continue; } else { break; @@ -260,10 +252,14 @@ function extractReservedRooms(sheet) { row.eachCell((cell) => { if (cell.address === address) return; - result.push(cell.value.trim().length == 0 ? null : cell.value) + result.push(cell.value?.trim().length == 0 ? null : cell.value) }); }); + while (result.length < 10) { + result.push(null); + } + return result; } @@ -322,4 +318,4 @@ function formatNowTime() { ); } -//parseV3("db/current.xlsx") +parseV3("db/current.xlsx")