Commit b341146 1 parent 6045c87 commit b341146 Copy full SHA for b341146
File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ export const formatBytes = (bytes?: number | string) => {
18
18
const fmtHourMinute = new Intl . DateTimeFormat ( undefined , {
19
19
hour : "2-digit" ,
20
20
minute : "2-digit" ,
21
+ day : "2-digit" ,
22
+ month : "2-digit" ,
23
+ year : "numeric" ,
21
24
} ) ;
22
25
23
26
const timezoneOffsetMs = new Date ( ) . getTimezoneOffset ( ) * 60 * 1000 ;
@@ -28,9 +31,8 @@ export const formatTime = (time: number | string | Date) => {
28
31
} else if ( time instanceof Date ) {
29
32
time = time . getTime ( ) ;
30
33
}
31
- const d = new Date ( ) ;
32
- d . setTime ( time - timezoneOffsetMs ) ;
33
- return d . toISOString ( ) . substring ( 0 , 10 ) + " at " + fmtHourMinute . format ( d ) ;
34
+ const d = new Date ( time ) ;
35
+ return fmtHourMinute . format ( d ) ;
34
36
} ;
35
37
36
38
export const localISOTime = ( time : number | string | Date ) => {
You can’t perform that action at this time.
0 commit comments