Skip to content

Commit

Permalink
fix: fix filter in issue analyze script
Browse files Browse the repository at this point in the history
  • Loading branch information
DaiQiangReal committed Oct 9, 2023
1 parent 4f9b165 commit be5bdd3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const main = async () => {

}

console.log(`Find ${list.length} issues since ${since}`);
console.log(`Find ${list.length} updated issues since ${since}`);

const result = {};

Expand All @@ -53,13 +53,19 @@ const main = async () => {
const createdAt = issue['created_at'];
const closedAt = issue['closed_at'];
(()=>{
if (new Date(createdAt).getFullYear()!== new Date().getFullYear()) {
return;
}
const tmp = lodash.get(result, [`q${whichQ(createdAt)}`, "created"], []);
tmp.push(issue);
lodash.set(result, [`q${whichQ(createdAt)}`, "created"], tmp);
})();

if (closedAt!==null) {
(()=>{
if (new Date(closedAt).getFullYear()!== new Date().getFullYear()) {
return;
}
const tmp = lodash.get(result, [`q${whichQ(closedAt)}`, "closed"], []);
tmp.push(issue);
lodash.set(result, [`q${whichQ(closedAt)}`, "closed"], tmp);
Expand Down

0 comments on commit be5bdd3

Please sign in to comment.