File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -77,14 +77,16 @@ function loadSiteCallback(result) {
7777 $ ( '#siteStandardOutput' ) . html ( formatted ) ;
7878}
7979
80+ function formatUnixDate ( unixTime ) {
81+ const time = unixTime < 1e12 ? unixTime * 1000 : unixTime ;
82+ return new Date ( time ) . toLocaleString ( ) ;
83+ }
84+
8085function loadAPIKeysCallback ( result ) {
81- console . log ( 'bare result function received' , result ) ;
8286 const textToHighlight = '"disabled": true' ;
8387 let resultJson = JSON . parse ( result ) ;
8488 resultJson = resultJson . map ( ( item ) => {
85- console . log ( `Raw created value: ${ item . created } ` ) ; // Before formatting
86- const created = new Date ( item . created * 1000 ) . toLocaleString ( ) ;
87- console . log ( `Formatted created time: ${ created } ` ) ; // After formatting
89+ const created = new Date ( formatUnixDate ( item . created ) ) . toLocaleString ( ) ;
8890 return { ...item , created } ;
8991 } ) ;
9092 const formatted = prettifyJson ( JSON . stringify ( resultJson ) ) ;
You can’t perform that action at this time.
0 commit comments