Skip to content

Commit ef403a9

Browse files
committed
fix: relative dates with minutes not being rounded
1 parent 0102c04 commit ef403a9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

scripts/github-notifications.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function humanRelativeDate(isoDateStr) {
3131
let delta;
3232
if (deltaMins < 60) {
3333
unit = "minute";
34-
delta = deltaMins
34+
delta = Math.floor(deltaMins);
3535
} else if (deltaMins < 60 * 24) {
3636
unit = "hour";
3737
delta = Math.floor(deltaMins / 60);

scripts/my-github-prs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function humanRelativeDate(isoDateStr) {
2929
let delta;
3030
if (deltaMins < 60) {
3131
unit = "minute";
32-
delta = deltaMins
32+
delta = Math.floor(deltaMins);
3333
} else if (deltaMins < 60 * 24) {
3434
unit = "hour";
3535
delta = Math.floor(deltaMins / 60);

scripts/public-github-repo-search.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function humanRelativeDate(isoDateStr) {
2727
let delta;
2828
if (deltaMins < 60) {
2929
unit = "minute";
30-
delta = deltaMins
30+
delta = Math.floor(deltaMins);
3131
} else if (deltaMins < 60 * 24) {
3232
unit = "hour";
3333
delta = Math.floor(deltaMins / 60);

0 commit comments

Comments
 (0)