Skip to content
This repository was archived by the owner on Nov 14, 2025. It is now read-only.

Commit d081955

Browse files
authored
Update milestone retrieval logic to return the next milestone if due in less than 14 days (#340)
1 parent a00357c commit d081955

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

api/octokit.js

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/octokit.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,13 @@ export class OctoKit implements GitHub {
241241
}
242242

243243
if (isEndGame && possibleMilestones.length > 1) {
244-
// TODO: Bhavya undo this for Jan 2025.
245-
// https://github.com/microsoft/vscode-engineering/issues/971
246-
// If we are in endgame, return the next milestone.
247-
// return possibleMilestones[1].number;
244+
const timeDiff =
245+
new Date(possibleMilestones[0].due_on ?? currentDate).getTime() - currentDate.getTime();
246+
const daysDiff = timeDiff / (1000 * 3600 * 24);
247+
// If the milestone is less than 14 days away, use the next milestone
248+
if (daysDiff < 14) {
249+
return possibleMilestones[1].number;
250+
}
248251
}
249252

250253
return possibleMilestones[0].number;

0 commit comments

Comments
 (0)