Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changeset/some-numbers-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"sandbox": patch
---

Improve timeout hour format and example values
2 changes: 1 addition & 1 deletion packages/sandbox/src/args/timeout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as cmd from "cmd-ts";
export const timeout = cmd.option({
long: "timeout",
type: Duration,
description: "The maximum duration a sandbox can run for. Example: 5m, 1h",
description: "The maximum duration a sandbox can run for. Example: 5m, 30m",
defaultValue: () => "5 minutes" as const,
defaultValueIsSerializable: true,
});
8 changes: 3 additions & 5 deletions packages/sandbox/src/util/output.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { formatDistance } from "date-fns/formatDistance";
import { formatDistanceStrict } from "date-fns/formatDistanceStrict";
import chalk, { ChalkInstance } from "chalk";
import { stripVTControlCharacters } from "node:util";

Expand Down Expand Up @@ -29,11 +29,9 @@ export function timeAgo(date: string | number | Date | undefined) {
return '-';
}

return formatDistance(date, new Date(), {
return formatDistanceStrict(date, new Date(), {
addSuffix: true,
})
.replace("about ", "")
.replace("less than ", "");
});
}

export function table<T extends object>(opts: {
Expand Down
Loading