diff --git a/apps/web/src/components/settings/scheduledTasksSettings.logic.test.ts b/apps/web/src/components/settings/scheduledTasksSettings.logic.test.ts index 807b10b8cc5e..2c96157e831f 100644 --- a/apps/web/src/components/settings/scheduledTasksSettings.logic.test.ts +++ b/apps/web/src/components/settings/scheduledTasksSettings.logic.test.ts @@ -172,6 +172,16 @@ describe("editing scheduled task branch settings", () => { }); }); +describe("fixed-time scheduled tasks", () => { + it("pads a stored single-digit hour so the time input shows it", () => { + const draft = taskToDraft({ + ...legacyTask, + schedule: { type: "fixed_time", timeOfDay: "9:05" }, + }); + expect(draft.timeOfDay).toBe("09:05"); + }); +}); + describe("scheduled task destination", () => { it("unbinding leaves the shared checkout for a new worktree from the remote", () => { const rootBound = taskToDraft({ diff --git a/apps/web/src/components/settings/scheduledTasksSettings.logic.ts b/apps/web/src/components/settings/scheduledTasksSettings.logic.ts index 8d6a29a6d185..26d83da69f42 100644 --- a/apps/web/src/components/settings/scheduledTasksSettings.logic.ts +++ b/apps/web/src/components/settings/scheduledTasksSettings.logic.ts @@ -253,7 +253,8 @@ export function taskToDraft(task: ScheduledTask): DraftState { scheduleMode: schedule.type === "fixed_time" ? "fixed" : schedule.type, intervalMinutes: schedule.type === "interval" ? String(Math.max(1, schedule.everyMs / 60_000)) : "15", - timeOfDay: schedule.type === "fixed_time" ? schedule.timeOfDay : "09:00", + // A time input shows nothing for an unpadded hour such as 9:05, which agents may save. + timeOfDay: schedule.type === "fixed_time" ? schedule.timeOfDay.padStart(5, "0") : "09:00", runAt: schedule.type === "once" ? toDateTimeLocalValue(new Date(schedule.runAt)) : "", savedRunAt: schedule.type === "once" ? schedule.runAt : "", weekdays,