File tree 2 files changed +27
-3
lines changed 2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ import {
16
16
} from "@gitpod/gitpod-protocol/lib/usage" ;
17
17
import { AttributionId } from "@gitpod/gitpod-protocol/lib/attribution" ;
18
18
import { Item , ItemField , ItemsList } from "../components/ItemsList" ;
19
- import moment from "moment" ;
20
19
import Pagination from "../Pagination/Pagination" ;
21
20
import Header from "../components/Header" ;
22
21
import { ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error" ;
@@ -139,6 +138,17 @@ function TeamUsage() {
139
138
return rows ;
140
139
} ;
141
140
141
+ const displayTime = ( time : string ) => {
142
+ const options : Intl . DateTimeFormatOptions = {
143
+ day : "numeric" ,
144
+ month : "long" ,
145
+ year : "numeric" ,
146
+ hour : "numeric" ,
147
+ minute : "numeric" ,
148
+ } ;
149
+ return new Date ( time ) . toLocaleDateString ( "en-US" , options ) ;
150
+ } ;
151
+
142
152
const lastResultOnCurrentPage = currentPage * resultsPerPage ;
143
153
const firstResultOnCurrentPage = lastResultOnCurrentPage - resultsPerPage ;
144
154
const totalNumberOfPages = Math . ceil ( billedUsage . length / resultsPerPage ) ;
@@ -250,7 +260,7 @@ function TeamUsage() {
250
260
</ div >
251
261
< div className = "my-auto" >
252
262
< span className = "text-gray-400" >
253
- { moment ( new Date ( usage . startTime ) . toDateString ( ) ) . utc ( ) }
263
+ { displayTime ( usage . startTime ) }
254
264
</ span >
255
265
</ div >
256
266
</ div >
Original file line number Diff line number Diff line change @@ -2174,7 +2174,21 @@ export class GitpodServerEEImpl extends GitpodServerImpl {
2174
2174
) ;
2175
2175
const sessions = response . getSessionsList ( ) . map ( ( s ) => UsageService . mapBilledSession ( s ) ) ;
2176
2176
2177
- return sessions ;
2177
+ return sessions . concat ( [
2178
+ {
2179
+ attributionId : "some-attribution-id" ,
2180
+ userId : "prebuild" ,
2181
+ teamId : "prebuild" ,
2182
+ instanceId : "some-instance-id" ,
2183
+ workspaceId : "some-workspace-id" ,
2184
+ workspaceType : "prebuild" ,
2185
+ workspaceClass : "XL" ,
2186
+ startTime : new Date ( Date . now ( ) + - 3 * 24 * 3600 * 1000 ) . toISOString ( ) , // 3 days ago
2187
+ endTime : new Date ( ) . toISOString ( ) ,
2188
+ credits : 320 ,
2189
+ projectId : "project-123" ,
2190
+ } ,
2191
+ ] ) ;
2178
2192
}
2179
2193
2180
2194
protected async guardCostCenterAccess (
You can’t perform that action at this time.
0 commit comments