File tree Expand file tree Collapse file tree 1 file changed +20
-20
lines changed
Expand file tree Collapse file tree 1 file changed +20
-20
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,26 @@ dayjs.extend(dayjsRelativeTime);
1717dayjs . extend ( dayjsUtc ) ;
1818dayjs . extend ( dayjsUpdateLocale ) ;
1919
20+ // Configure dayjs for shorter relative time format
21+ dayjs . updateLocale ( "en" , {
22+ relativeTime : {
23+ future : "in %s" ,
24+ past : "%s ago" ,
25+ s : "now" ,
26+ ss : "now" ,
27+ m : "1m" ,
28+ mm : "%dm" ,
29+ h : "1h" ,
30+ hh : "%dh" ,
31+ d : "1d" ,
32+ dd : "%dd" ,
33+ M : "1mo" ,
34+ MM : "%dmo" ,
35+ y : "1y" ,
36+ yy : "%dy" ,
37+ } ,
38+ } ) ;
39+
2040export default ( props ) => {
2141 const {
2242 id,
@@ -55,26 +75,6 @@ export default (props) => {
5575 if ( ! dateString ) return null ;
5676
5777 try {
58- // Configure dayjs for shorter relative time format
59- dayjs . updateLocale ( "en" , {
60- relativeTime : {
61- future : "in %s" ,
62- past : "%s ago" ,
63- s : "now" ,
64- ss : "now" ,
65- m : "1m" ,
66- mm : "%dm" ,
67- h : "1h" ,
68- hh : "%dh" ,
69- d : "1d" ,
70- dd : "%dd" ,
71- M : "1mo" ,
72- MM : "%dmo" ,
73- y : "1y" ,
74- yy : "%dy" ,
75- } ,
76- } ) ;
77-
7878 const updateTime = dayjs . utc ( dateString ) ;
7979 if ( ! updateTime . isValid ( ) ) return null ;
8080
You can’t perform that action at this time.
0 commit comments