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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
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 |
newSessionTime | TimeSpan | - |
Returns
Section titled “Returns”{ adjustedTimeSpan: TimeSpan[] | null; collisionFragments: TimeSpan[] | null;}Adjusted session and collision fragments
| Name | Type | Defined in |
|---|---|---|
adjustedTimeSpan | TimeSpan[] | null | shared/src/helper/workHelper/workHelperFunctions.ts:208 |
collisionFragments | TimeSpan[] | null | shared/src/helper/workHelper/workHelperFunctions.ts:209 |