Skip to content

Function: filterOutExistingSessionTimes()

function filterOutExistingSessionTimes(existingSessions, newSessionTime): {
adjustedTimeSpan: TimeSpan[] | null;
collisionFragments: TimeSpan[] | null;
};

Defined in: shared/src/helper/workHelper/workHelperFunctions.ts:204

Filters out existing sessions that overlap with the new session. If there are collisions, adjusts the session to fit the collisions.

ParameterTypeDescription
existingSessions{ active_seconds: number; created_at: string; currency: | "USD" | "EUR" | "GBP" | "CAD" | "AUD" | "JPY" | "CHF" | "CNY" | "INR" | "BRL" | "VEF"; end_time: string; hourly_payment: boolean; id: string; memo: string | null; paid: boolean; payout_id: string | null; salary: number; start_time: string; time_fragments_interval: number | null; user_id: string; work_project_id: string; }[]Existing sessions
newSessionTimeTimeSpan-
{
adjustedTimeSpan: TimeSpan[] | null;
collisionFragments: TimeSpan[] | null;
}

Adjusted session and collision fragments

NameTypeDefined in
adjustedTimeSpanTimeSpan[] | nullshared/src/helper/workHelper/workHelperFunctions.ts:208
collisionFragmentsTimeSpan[] | nullshared/src/helper/workHelper/workHelperFunctions.ts:209