This commit is contained in:
@@ -176,12 +176,11 @@ export default async function parseV1V2(downloadedFilePath) {
|
||||
}
|
||||
})
|
||||
|
||||
let i = 0;
|
||||
const absenceRange = new Set(["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "L"])
|
||||
for (const absenceKeyCur of allAbsenceKeys) {
|
||||
if (i >= 10) {
|
||||
break; // stop once 10 items are added
|
||||
}
|
||||
i++;
|
||||
if (!absenceRange.has(absenceKeyCur.substring(0, 1))) {
|
||||
break;
|
||||
};
|
||||
|
||||
const cell = currentSheet.getCell(absenceKeyCur);
|
||||
const value = (cell.value || "").toString().trim();
|
||||
|
||||
@@ -368,11 +368,12 @@ function extractAbsence(sheet, teacherMap) {
|
||||
|
||||
const row = sheet.getRow(sheet.getCell(absenceAddress).row);
|
||||
const results = [];
|
||||
let i = 0;
|
||||
const absenceRange = new Set(["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "L"])
|
||||
|
||||
row.eachCell((cell) => {
|
||||
if (cell.address === absenceAddress || i >= 10) return;
|
||||
i++;
|
||||
if (cell.address === absenceAddress || !absenceRange.has(cell.address.substring(0, 1))) {
|
||||
return
|
||||
};
|
||||
|
||||
const value = (cell.value || "").toString().trim();
|
||||
if (!value) return;
|
||||
@@ -402,4 +403,4 @@ function formatNowTime() {
|
||||
);
|
||||
}
|
||||
|
||||
parseV3("db/current.xlsx")
|
||||
//parseV3("db/current.xlsx")
|
||||
|
||||
Reference in New Issue
Block a user