Skip to content

Commit

Permalink
feat(logs): round the difference of days in the logs
Browse files Browse the repository at this point in the history
  • Loading branch information
C0ZEN committed Nov 14, 2021
1 parent ef6e1b4 commit 6801ee5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions src/core/issues/issue-stale-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ export class IssueStaleProcessor {
this.issueProcessor.logger.info(`The issue was updated for the last time the`, LoggerService.date(updatedAt));

const numberOfDaysBeforeStale: number = InputsService.getInputs().issueDaysBeforeStale;
const daysDifference: number = DateTime.now().diff(updatedAt, `days`, {
conversionAccuracy: `longterm`,
}).days;
const daysDifference: number = _.round(
DateTime.now().diff(updatedAt, `days`, {
conversionAccuracy: `longterm`,
}).days,
1
);
const isStale: boolean = daysDifference > numberOfDaysBeforeStale;

if (isStale) {
Expand Down

0 comments on commit 6801ee5

Please sign in to comment.