Skip to content

Commit 6528d00

Browse files
committed
improv: m -> min, more distinct from 'month'
1 parent a338d44 commit 6528d00

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

scripts/github-notifications.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ function humanRelativeDate(isoDateStr) {
5454
delta = Math.ceil(deltaSecs / 60 / 60 / 24 / 7 / 4 / 12);
5555
}
5656
const formatter = new Intl.RelativeTimeFormat("en", { style: "long", numeric: "auto" });
57-
return formatter.format(-delta, unit);
57+
const str = formatter.format(-delta, unit);
58+
return str.replace(/m(?= ago)$/g, "min"); // "m" -> "min" (more distinguishable from "month")
5859
}
5960

6061
//──────────────────────────────────────────────────────────────────────────────

scripts/my-github-prs.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ function humanRelativeDate(isoDateStr) {
4343
delta = Math.ceil(deltaSecs / 60 / 60 / 24 / 7 / 4 / 12);
4444
}
4545
const formatter = new Intl.RelativeTimeFormat("en", { style: "long", numeric: "auto" });
46-
return formatter.format(-delta, unit);
46+
const str = formatter.format(-delta, unit);
47+
return str.replace(/m(?= ago)$/g, "min"); // "m" -> "min" (more distinguishable from "month")
4748
}
4849

4950
//──────────────────────────────────────────────────────────────────────────────

scripts/public-github-repo-search.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ function humanRelativeDate(isoDateStr) {
4747
delta = Math.ceil(deltaSecs / 60 / 60 / 24 / 7 / 4 / 12);
4848
}
4949
const formatter = new Intl.RelativeTimeFormat("en", { style: "narrow", numeric: "auto" });
50-
return formatter.format(-delta, unit);
50+
const str = formatter.format(-delta, unit);
51+
return str.replace(/m(?= ago)$/g, "min"); // "m" -> "min" (more distinguishable from "month")
5152
}
5253

5354
//──────────────────────────────────────────────────────────────────────────────

0 commit comments

Comments
 (0)