Skip to content

Commit

Permalink
fix retro logic and add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
hross committed May 26, 2020
1 parent 26755fd commit f40a49a
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 f40a49a

Please sign in to comment.