@@ -23,6 +23,7 @@ import { IProductService } from 'vs/platform/product/common/productService';
2323import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService' ;
2424import { IElectronService } from 'vs/platform/electron/node/electron' ;
2525import { MessageBoxOptions } from 'electron' ;
26+ import { fromNow } from 'vs/base/common/date' ;
2627
2728interface IMassagedMessageBoxOptions {
2829
@@ -216,17 +217,23 @@ class NativeDialogService implements IDialogService {
216217 }
217218
218219 const isSnap = process . platform === 'linux' && process . env . SNAP && process . env . SNAP_REVISION ;
219- const detail = nls . localize ( 'aboutDetail' ,
220- "Version: {0}\nCommit: {1}\nDate: {2}\nElectron: {3}\nChrome: {4}\nNode.js: {5}\nV8: {6}\nOS: {7}" ,
221- version ,
222- product . commit || 'Unknown' ,
223- product . date || 'Unknown' ,
224- process . versions [ 'electron' ] ,
225- process . versions [ 'chrome' ] ,
226- process . versions [ 'node' ] ,
227- process . versions [ 'v8' ] ,
228- `${ os . type ( ) } ${ os . arch ( ) } ${ os . release ( ) } ${ isSnap ? ' snap' : '' } `
229- ) ;
220+
221+ const detailString = ( useAgo : boolean ) : string => {
222+ return nls . localize ( 'aboutDetail' ,
223+ "Version: {0}\nCommit: {1}\nDate: {2}\nElectron: {3}\nChrome: {4}\nNode.js: {5}\nV8: {6}\nOS: {7}" ,
224+ version ,
225+ product . commit || 'Unknown' ,
226+ product . date ? `${ product . date } ${ useAgo ? ' (' + fromNow ( new Date ( product . date ) , true ) + ')' : '' } ` : 'Unknown' ,
227+ process . versions [ 'electron' ] ,
228+ process . versions [ 'chrome' ] ,
229+ process . versions [ 'node' ] ,
230+ process . versions [ 'v8' ] ,
231+ `${ os . type ( ) } ${ os . arch ( ) } ${ os . release ( ) } ${ isSnap ? ' snap' : '' } `
232+ ) ;
233+ } ;
234+
235+ const detail = detailString ( true ) ;
236+ const detailToCopy = detailString ( false ) ;
230237
231238 const ok = nls . localize ( 'okButton' , "OK" ) ;
232239 const copy = mnemonicButtonLabel ( nls . localize ( { key : 'copy' , comment : [ '&& denotes a mnemonic' ] } , "&&Copy" ) ) ;
@@ -249,7 +256,7 @@ class NativeDialogService implements IDialogService {
249256 } ) ;
250257
251258 if ( buttons [ result . response ] === copy ) {
252- this . clipboardService . writeText ( detail ) ;
259+ this . clipboardService . writeText ( detailToCopy ) ;
253260 }
254261 }
255262}
0 commit comments