File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -15,14 +15,22 @@ const duration = pt => {
15
15
16
16
function localiseTimes ( all ) {
17
17
for ( const elt of Array . from ( document . getElementsByTagName ( 'time' ) ) ) {
18
- if ( elt . classList . contains ( 'ago' ) )
18
+ if ( elt . classList . contains ( 'ago' ) ) {
19
+ elt . title = elt . innerText . slice ( elt . innerText . indexOf ( '[' ) + 1 , - 1 )
19
20
elt . innerText = ` [${ formatDistanceToNow ( elt . dateTime , optionsAgo ) } ]`
20
- else if ( elt . classList . contains ( 'since' ) )
21
+ }
22
+ else if ( elt . classList . contains ( 'since' ) ) {
23
+ elt . title = elt . innerText
21
24
elt . innerText = `[elapsed: ${ formatDistanceToNow ( elt . dateTime ) } ]`
22
- else if ( elt . classList . contains ( 'duration' ) )
25
+ }
26
+ else if ( elt . classList . contains ( 'duration' ) ) {
27
+ elt . title = elt . innerText
23
28
elt . innerText = `[average: ${ formatDuration ( duration ( elt . dateTime ) ) } ]`
24
- else if ( all )
29
+ }
30
+ else if ( all ) {
31
+ elt . title = elt . innerText
25
32
elt . innerText = format ( elt . dateTime , dateFormat )
33
+ }
26
34
}
27
35
}
28
36
You can’t perform that action at this time.
0 commit comments