File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
3
const styles = require ( './styles' ) ;
4
+ const lastModifiedToString = require ( './last-modified-to-string' ) ;
4
5
const permsToString = require ( './perms-to-string' ) ;
5
6
const sizeToString = require ( './size-to-string' ) ;
6
7
const sortFiles = require ( './sort-files' ) ;
@@ -114,6 +115,7 @@ module.exports = (opts) => {
114
115
html += `<td class="perms"><code>(${ permsToString ( file [ 1 ] ) } )</code></td>` ;
115
116
}
116
117
html +=
118
+ `<td class="last-modified">${ lastModifiedToString ( file [ 1 ] ) } </td>` +
117
119
`<td class="file-size"><code>${ sizeToString ( file [ 1 ] , humanReadable , si ) } </code></td>` +
118
120
`<td class="display-name"><a href="${ href } ">${ displayName } </a></td>` +
119
121
'</tr>\n' ;
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ module . exports = function lastModifiedToString ( stat ) {
4
+ const t = new Date ( stat . mtime ) ;
5
+ return ( ( "0" + ( t . getDate ( ) ) ) . slice ( - 2 ) + '-' +
6
+ t . toLocaleString ( 'default' , { month : 'short' } ) + '-' +
7
+ t . getFullYear ( ) + ' ' +
8
+ ( "0" + t . getHours ( ) ) . slice ( - 2 ) + ':' +
9
+ ( "0" + t . getMinutes ( ) ) . slice ( - 2 ) ) ;
10
+ } ;
You can’t perform that action at this time.
0 commit comments