Skip to content

Commit

Permalink
Merge pull request #4 from hross/fix_retro_logic
Browse files Browse the repository at this point in the history
fix retro logic and add logging
  • Loading branch information
hross committed May 26, 2020
2 parents 26755fd + f40a49a commit 4a14868
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7433,8 +7433,12 @@ function whoIsNext(handles, retroCadenceInWeeks) {
const today = new Date();
const diff = today.getTime() - firstWeek.getTime();
const daysSince = Math.floor(diff / (1000 * 60 * 60 * 24));
core.info(`Days since: ${daysSince}`);
const retrosSince = Math.floor(daysSince / (7 * retroCadenceInWeeks));
const index = Math.ceil((retrosSince / 2) % handles.length);
core.info(`Retros since: ${retrosSince}`);
core.info(`List of handles length: ${handles.length}`);
const index = Math.floor(retrosSince % handles.length);
core.info(`Handle index: ${index}`);
const nxt = handles[index];
return nxt;
}
Expand Down
6 changes: 5 additions & 1 deletion src/retro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,12 @@ function whoIsNext(handles: string[], retroCadenceInWeeks: number): string {
const today = new Date()
const diff = today.getTime() - firstWeek.getTime()
const daysSince = Math.floor(diff / (1000 * 60 * 60 * 24))
core.info(`Days since: ${daysSince}`)
const retrosSince = Math.floor(daysSince / (7 * retroCadenceInWeeks))
const index = Math.ceil((retrosSince / 2) % handles.length)
core.info(`Retros since: ${retrosSince}`)
core.info(`List of handles length: ${handles.length}`)
const index = Math.floor(retrosSince % handles.length)
core.info(`Handle index: ${index}`)
const nxt = handles[index]

return nxt
Expand Down

0 comments on commit 4a14868

Please sign in to comment.