Skip to content

Commit b09264b

Browse files
Laurie T. Malauroboquat
Laurie T. Malau
authored andcommitted
Use actual date
1 parent 30a5834 commit b09264b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

components/dashboard/src/teams/TeamUsage.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
} from "@gitpod/gitpod-protocol/lib/usage";
1717
import { AttributionId } from "@gitpod/gitpod-protocol/lib/attribution";
1818
import { Item, ItemField, ItemsList } from "../components/ItemsList";
19-
import moment from "moment";
2019
import Pagination from "../Pagination/Pagination";
2120
import Header from "../components/Header";
2221
import { ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error";
@@ -139,6 +138,17 @@ function TeamUsage() {
139138
return rows;
140139
};
141140

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(undefined, options).replace("at ", "");
150+
};
151+
142152
const lastResultOnCurrentPage = currentPage * resultsPerPage;
143153
const firstResultOnCurrentPage = lastResultOnCurrentPage - resultsPerPage;
144154
const totalNumberOfPages = Math.ceil(billedUsage.length / resultsPerPage);
@@ -250,7 +260,7 @@ function TeamUsage() {
250260
</div>
251261
<div className="my-auto">
252262
<span className="text-gray-400">
253-
{moment(new Date(usage.startTime).toDateString()).fromNow()}
263+
{displayTime(usage.startTime)}
254264
</span>
255265
</div>
256266
</div>

0 commit comments

Comments
 (0)