From d49e5f75eb20836c0ca70b7ff88141be0ee067ba Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Thu, 22 Aug 2024 21:59:18 +0530 Subject: [PATCH] Scraper: Fixes incorrect default date range --- scraper/src/github-scraper/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scraper/src/github-scraper/index.ts b/scraper/src/github-scraper/index.ts index e2ea93b3..1db519a3 100644 --- a/scraper/src/github-scraper/index.ts +++ b/scraper/src/github-scraper/index.ts @@ -65,14 +65,14 @@ const main = async () => { if (dateArg) { date = new Date(dateArg).toISOString(); } else { - date = formatISO(subDays(new Date(), 1), { representation: "date" }); + date = formatISO(new Date(), { representation: "date" }); } } catch (error) { console.error("Invalid date value:", dateArg); process.exit(1); } - const endDate: Date = startOfDay(parseISO(date)); - const startDate: Date = startOfDay(subDays(endDate, Number(numDays))); + const endDate = parseISO(date); + const startDate = subDays(endDate, Number(numDays)); await scrapeGitHub(orgName, endDate, startDate); await mergedData(dataDir, processedData);