MCPcopy Create free account
hub / github.com/coder/coder / displayDormantDeletion

Function displayDormantDeletion

site/src/utils/dormant.ts:14–28  ·  view source on GitHub ↗
(
	workspace: Workspace,
	allowAdvancedScheduling: boolean,
)

Source from the content-addressed store, hash-verified

12 * @returns {boolean}
13 */
14export const displayDormantDeletion = (
15 workspace: Workspace,
16 allowAdvancedScheduling: boolean,
17) => {
18 const today = new Date();
19 if (!workspace.deleting_at || !allowAdvancedScheduling) {
20 return false;
21 }
22 return (
23 new Date(workspace.deleting_at) <=
24 new Date(
25 today.setDate(today.getDate() + IMPENDING_DELETION_DISPLAY_THRESHOLD),
26 )
27 );
28};

Callers 2

dormant.test.tsFile · 0.90
WorkspaceTopbarFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected