Skip to content

feature: allow editing workspace deadline in UI #2721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jun 30, 2022
Prev Previous commit
Next Next commit
fixup! add unit tests for workspace deadline buttons
  • Loading branch information
johnstcn committed Jun 30, 2022
commit b2cd9ffbdd9e1187dd39c657828c93d274906891
4 changes: 2 additions & 2 deletions site/src/components/WorkspaceSchedule/WorkspaceSchedule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ export const shouldDisplayPlusMinus = (workspace: Workspace): boolean => {

export const deadlineMinusDisabled = (workspace: Workspace, now: dayjs.Dayjs): boolean => {
const delta = dayjs(workspace.latest_build.deadline).diff(now)
return Math.abs(delta) <= 30 * 60 * 1000 // 30 minutes
return delta <= 30 * 60 * 1000 // 30 minutes
}

export const deadlinePlusDisabled = (workspace: Workspace, now: dayjs.Dayjs): boolean => {
const delta = dayjs(workspace.latest_build.deadline).diff(now)
return Math.abs(delta) >= 24 * 60 * 60 * 1000 // 24 hours
return delta >= 24 * 60 * 60 * 1000 // 24 hours
}

export const WorkspaceSchedule: FC<WorkspaceScheduleProps> = ({
Expand Down