Skip to content

Commit 375bd1d

Browse files
committed
show shorter relative time format
1 parent 2910cb1 commit 375bd1d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/pages/plugin/plugin.view.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,26 @@ export default (props) => {
4848
if (!dateString) return null;
4949

5050
try {
51+
// Configure moment for shorter relative time format
52+
moment.updateLocale("en", {
53+
relativeTime: {
54+
future: "in %s",
55+
past: "%s ago",
56+
s: "now",
57+
ss: "now",
58+
m: "1m",
59+
mm: "%dm",
60+
h: "1h",
61+
hh: "%dh",
62+
d: "1d",
63+
dd: "%dd",
64+
M: "1mo",
65+
MM: "%dmo",
66+
y: "1y",
67+
yy: "%dy",
68+
},
69+
});
70+
5171
const updateTime = moment.utc(dateString);
5272
if (!updateTime.isValid()) return null;
5373

0 commit comments

Comments
 (0)