Kaizen
Browse modulesAccessaccess/sharedFunctions

Function: isWithinEffectiveDates()

function isWithinEffectiveDates(
   start: string | Date | null | undefined, 
   end: string | Date | null | undefined, 
   now: Date
): boolean;

Defined in: shared/access/kernel.ts:206

Is now within the effective window [start, end] — inclusive on both bounds, open-ended on a null/undefined bound? Tolerant of string | Date inputs (ISO strings from a compiled snapshot, raw Date columns from the DB). An unparseable bound is ignored (treated as no bound) so a malformed date never silently denies on the wrong side.

Deny-by-default semantics: now < start and now > end both exclude; equality with either bound is inside the window. Single source of truth for every effective-date check in the access module — the kernel's grant-typed withinEffectiveDates and the server services all funnel here.

Parameters

ParameterType
startstring | Date | null | undefined
endstring | Date | null | undefined
nowDate

Returns

boolean

On this page