From 5b13f10f938267cca6c45f8d42e97511eb2b4af6 Mon Sep 17 00:00:00 2001 From: Melissa Xie Date: Tue, 10 Aug 2021 00:00:13 +0000 Subject: [PATCH] Print parsed date for debugging --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index d7a8bdd..4d66936 100644 --- a/index.js +++ b/index.js @@ -27,20 +27,22 @@ async function run() { if (results !== null) { let [month, day, year] = results.slice(1); - // in case it's a 2-digit year + // if the year is under 100, assume it's from the 2000s if (year < 100) { year += 2000; } const issueDate = new Date(year, month - 1, day); + console.log(`Date found in title: ${issueDate.toDateString()}`) + if (issueDate < today) { octokit.issues.update({ ...ghContext.repo, issue_number: issueNumber, state: "closed", }); - + console.log(`Closed #${issue.number}.`); issuesClosed++;