Skip to content
Merged
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
16 changes: 15 additions & 1 deletion src/lib/vm/image/show.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@ import { Command } from "@commander-js/extra-typings";
import { Box, render, Text } from "ink";
import Link from "ink-link";
import console from "node:console";
import dayjs from "dayjs";
import utc from "dayjs/plugin/utc";
import advanced from "dayjs/plugin/advancedFormat";
import timezone from "dayjs/plugin/timezone";
import { brightBlack } from "jsr:@std/fmt/colors";
import { handleNodesError, nodesClient } from "../../../nodesClient.ts";
import { Row } from "../../Row.tsx";
import { formatDate } from "../../../helpers/format-date.ts";

dayjs.extend(utc);
dayjs.extend(advanced);
dayjs.extend(timezone);

export function ImageDisplay(
{ image }: {
Expand Down Expand Up @@ -60,7 +70,11 @@ export function ImageDisplay(
value={
<Box gap={1}>
<Text color={isExpired ? "red" : undefined}>
{expiresAt.toISOString()}
{expiresAt.toISOString()} {brightBlack(
`(${formatDate(dayjs(expiresAt).toDate())} ${
dayjs(expiresAt).format("z")
})`,
)}
</Text>
{isExpired && <Text dimColor>(Expired)</Text>}
</Box>
Expand Down