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 11'use strict' ;
22
33const styles = require ( './styles' ) ;
4+ const lastModifiedToString = require ( './last-modified-to-string' ) ;
45const permsToString = require ( './perms-to-string' ) ;
56const sizeToString = require ( './size-to-string' ) ;
67const sortFiles = require ( './sort-files' ) ;
@@ -114,6 +115,7 @@ module.exports = (opts) => {
114115 html += `<td class="perms"><code>(${ permsToString ( file [ 1 ] ) } )</code></td>` ;
115116 }
116117 html +=
118+ `<td class="last-modified">${ lastModifiedToString ( file [ 1 ] ) } </td>` +
117119 `<td class="file-size"><code>${ sizeToString ( file [ 1 ] , humanReadable , si ) } </code></td>` +
118120 `<td class="display-name"><a href="${ href } ">${ displayName } </a></td>` +
119121 '</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