Function: getTimeSectionSessions()
function getTimeSectionSessions( start, end, timeSectionInterval, originalSession): { 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;}[];Defined in: shared/src/helper/workHelper/workHelperFunctions.ts:84
Splits a session into multiple time blocks based on the specified interval.
Example: If a session runs from 17:17 to 17:36 and timeSectionInterval is “10min”, it will create 3 sessions:
- 17:10-17:20 (3 minutes active: 17:17-17:20)
- 17:20-17:30 (10 minutes active: 17:20-17:30)
- 17:30-17:40 (6 minutes active: 17:30-17:36)
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
start | Date | Start time of the original session |
end | Date | End time of the original session |
timeSectionInterval | number | Time interval for splitting (5, 10, 15, 30, 60) |
originalSession | { 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; } | Optional original session data to copy properties from |
originalSession.active_seconds | number | - |
originalSession.created_at? | string | - |
originalSession.currency? | | "USD" | "EUR" | "GBP" | "CAD" | "AUD" | "JPY" | "CHF" | "CNY" | "INR" | "BRL" | "VEF" | - |
originalSession.end_time | string | - |
originalSession.hourly_payment? | boolean | - |
originalSession.id? | string | - |
originalSession.memo? | string | null | - |
originalSession.paid? | boolean | - |
originalSession.payout_id? | string | null | - |
originalSession.salary | number | - |
originalSession.start_time | string | - |
originalSession.time_fragments_interval? | number | null | - |
originalSession.user_id? | string | - |
originalSession.work_project_id? | string | - |
Returns
Section titled “Returns”{
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;
}[]
Array of session objects split into time blocks