@devries-cameron20 / t3code Mirror · read-only / commits / 7b26203b8b
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 14:45 UTC

fix(mobile): scheduled tasks due within the hour no longer read "Next run in 60 minutes" (#29756)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

Alex Southwell committed Nov 15, 2026 at 03:26 UTC 7b26203b8bddf992bb20c6411f24fa1b7a106873
2 files changed +16 -2
apps/mobile/src/features/settings/scheduledTaskPresentation.test.ts new
+13
@@ -0,0 +1,13 @@
1 +import { describe, expect, it } from "vite-plus/test";
2 +
3 +import { formatNextScheduledTaskRun } from "./scheduledTaskPresentation";
4 +
5 +describe("formatNextScheduledTaskRun", () => {
6 + it("names the rounded unit for a run later today", () => {
7 + const now = new Date(2026, 10, 3, 10, 0, 0).getTime();
8 + const at = (minutes: number) => new Date(now + minutes * 60_000).toISOString();
9 + expect(formatNextScheduledTaskRun(at(59), now)).toBe("Next run in 59 minutes");
10 + expect(formatNextScheduledTaskRun(at(59.5), now)).toBe("Next run in 1 hour");
11 + expect(formatNextScheduledTaskRun(at(150), now)).toBe("Next run in 3 hours");
12 + });
13 +});
apps/mobile/src/features/settings/scheduledTaskPresentation.ts
+3 -2
@@ -38,8 +38,9 @@ export function formatNextScheduledTaskRun(nextRunAt: string, now: number): stri
38 const days = localCalendarDay(next) - localCalendarDay(current);
39 if (days === 0) {
40 if (remaining < MINUTE) return "Next run in less than a minute";
41 - const unit = remaining < HOUR ? "minute" : "hour";
42 - const count = Math.round(remaining / (remaining < HOUR ? MINUTE : HOUR));
41 + const minutes = Math.round(remaining / MINUTE);
42 + const unit = minutes < 60 ? "minute" : "hour";
43 + const count = minutes < 60 ? minutes : Math.round(remaining / HOUR);
44 return `Next run in ${count} ${unit}${count === 1 ? "" : "s"}`;
45 }
46