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
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading