Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ describe(BillingView.name, () => {
it("renders table with billing data", () => {
const { data } = setup();
expect(screen.getByText("History")).toBeInTheDocument();
expect(screen.getByText("Date")).toBeInTheDocument();
expect(screen.getByText("Date (UTC)")).toBeInTheDocument();
expect(screen.getByText("Amount")).toBeInTheDocument();
expect(screen.getByText("Account source")).toBeInTheDocument();
expect(screen.getByText("Status")).toBeInTheDocument();
expect(screen.getByText("Receipt")).toBeInTheDocument();

expect(screen.getByText(new Date(data[0].created * 1000).toLocaleDateString())).toBeInTheDocument();
expect(screen.getByText(new Date(data[0].created * 1000).toLocaleDateString(undefined, { timeZone: "UTC" }))).toBeInTheDocument();
expect(screen.getByText((data[0].amount / 100).toFixed(2))).toBeInTheDocument();
expect(screen.getByText(new RegExp(data[0].paymentMethod.card?.last4 || ""))).toBeInTheDocument();
expect(screen.getByText(/Succeeded|Pending|Failed/i)).toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ export const BillingView: React.FC<BillingViewProps> = ({

const columns = [
columnHelper.accessor("created", {
header: "Date",
cell: info => new Date(info.getValue() * 1000).toLocaleDateString()
header: "Date (UTC)",
// Render in UTC so the displayed day matches the Stripe charge timestamp
// regardless of the viewer's local timezone (see akash-network/console#2010).
cell: info => new Date(info.getValue() * 1000).toLocaleDateString(undefined, { timeZone: "UTC" })
}),
columnHelper.accessor("amount", {
header: "Amount",
Expand Down