From 5ac7049a9d30733165cc212dee308163c2a14644 Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Fri, 11 Mar 2022 20:41:42 +0200 Subject: Food scraping updation --- dbparse.js | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'dbparse.js') diff --git a/dbparse.js b/dbparse.js index b2204bd..dde0ff5 100644 --- a/dbparse.js +++ b/dbparse.js @@ -1,3 +1,5 @@ +const weekdayToNumber = require("./Functions/dateFuncs.js").weekdayToNumber; + function getCharAmount(s, c) { let n = 0; @@ -62,24 +64,6 @@ function parseCluttered(s) return s.replaceAll(".", "").replaceAll(" ", "").toUpperCase(); } -function weekdayToNumber(s) -{ - const weekdays = [ - /ma.*/i, - /ti.*/i, - /ke.*/i, - /to.*/i, - /pe.*/i, - /la.*/i, - /su.*/i - ]; - for(let day = 0; day < weekdays.length; day++) - { - if (s.match(weekdays[day])) - return day; - } -} - async function writeShifts(data, DB) { let deletions = await Promise.all([ -- cgit v1.2.3