Skip to content

Commit

Permalink
Update contributors-data.js
Browse files Browse the repository at this point in the history
  • Loading branch information
t-will-gillis authored Nov 24, 2023
1 parent 384f379 commit 634be7c
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions github-actions/trigger-schedule/github-data/contributors-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,20 @@ const org = 'hackforla';
const repo = 'website';
const team = 'website-write';

// Set date limits: at 1 month, warn member that they are inactive, and at 2 months remove contributor from team(s).
// Since the month of December is off for the website team, the January 1st run should be skipped. The February 1st run
// should warn members inactive since Jan 1st (1 mo ago), and remove members inactive since Nov 1st (3 mo. ago, skip Dec)
// Set date limits: we are sorting inactive members into groups to warn after 1 month and remove after 2 months.
// Since the website team takes off the month of December, the January 1st run is skipped (via `schedule-monthly.yml`).
// The February 1st run keeps the 1 month inactive warning, but changes removal to 3 months inactive (skipping December).
let today = new Date();
console.log("today " + today);
console.log("today.getMonth() " + today.getMonth());
// let twoMonth = (today.getMonth() == 2) ? 3 : 2;
let twoMonth = (today.getMonth() == 11) ? 6 : 2;
let twoMonth = (today.getMonth() == 1) ? 3 : 2; // If month is "February" == 1, then twoMonth = 3

let oneMonthAgo = new Date(); // oneMonthAgo instantiated with date of "today"
oneMonthAgo.setMonth(oneMonthAgo.getMonth() - 4); // then set oneMonthAgo from "today"
oneMonthAgo = oneMonthAgo.toISOString();
let twoMonthsAgo = new Date(); // twoMonthsAgo instantiated with date of "today"
// twoMonthsAgo.setMonth(twoMonthsAgo.getMonth() - 5); // then set twoMonthsAgo from "today"
twoMonthsAgo.setMonth(twoMonthsAgo.getMonth() - twoMonth); // then set twoMonthsAgo from "today"
let twoMonthsAgo = new Date(); // twoMonthsAgo instantiated with date of "today"
twoMonthsAgo.setMonth(twoMonthsAgo.getMonth() - twoMonths); // then set twoMonthsAgo from "today"
twoMonthsAgo = twoMonthsAgo.toISOString();
console.log("TESTING");
console.log("today.getMonth() " + today.getMonth());
console.log("twoMonth " + twoMonth);
console.log("twoMonthsAgo " + twoMonthsAgo.slice(0,10));



/**
* Main function, immediately invoked
Expand Down

0 comments on commit 634be7c

Please sign in to comment.