File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,8 +11,22 @@ export function AppBar() {
1111 } > ( { } ) ;
1212
1313 const showVersions = useCallback ( ( ) => {
14+ const convertVersion = ( v : string ) : string => {
15+ const timestamp : string = v . split ( "v" ) [ 1 ] ;
16+ const date : Date = new Date ( Number ( timestamp ) ) ;
17+
18+ const year : string = ( date . getFullYear ( ) ) . toString ( ) . padStart ( 4 , "0" ) ;
19+ const month : string = ( date . getMonth ( ) + 1 ) . toString ( ) . padStart ( 2 , "0" ) ;
20+ const day : string = ( date . getDate ( ) ) . toString ( ) . padStart ( 2 , "0" ) ;
21+ const hours : string = ( date . getHours ( ) ) . toString ( ) . padStart ( 2 , "0" ) ;
22+ const minutes : string = ( date . getMinutes ( ) ) . toString ( ) . padStart ( 2 , "0" ) ;
23+ const seconds : string = ( date . getSeconds ( ) ) . toString ( ) . padStart ( 2 , "0" ) ;
24+
25+ return `v${ year } .${ month } .${ day } .${ hours } ${ minutes } ${ seconds } ` ;
26+ } ;
27+
1428 const versionMessage = Object . entries ( version ) . map (
15- v => `${ v [ 0 ] } : ${ v [ 1 ] } `
29+ v => `${ v [ 0 ] } : ${ convertVersion ( v [ 1 ] ) } `
1630 ) . join ( "\n" ) ;
1731
1832 alert ( versionMessage ) ;
You can’t perform that action at this time.
0 commit comments