Function: calculateSessionTimeValues()
function calculateSessionTimeValues( activeSeconds, startTime, timerRoundingSettings): { calculatedEndTime: Date; finalActiveSeconds: number; normalizedStartTime: Date;};Defined in: shared/src/helper/workHelper/timeTrackerFunctions.ts:42
Calculates the time values for a timer session.
This function:
- Calculates the final active seconds (applying rounding if not using time fragments)
- Normalizes the start time to the beginning of the minute (removes seconds/milliseconds)
- Calculates the end time based on active
Note: The distinction between true_end_time (actual end) and end_time
(calculated end based on rounded time) allows tracking of actual vs billed time.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
activeSeconds | number | Raw active seconds from the timer |
startTime | number | null | Original start timestamp (can be null) |
timerRoundingSettings | TimerRoundingSettings | Permanent rounding settings |
Returns
Section titled “Returns”{ calculatedEndTime: Date; finalActiveSeconds: number; normalizedStartTime: Date;}Object containing finalActiveSeconds, normalizedStartTime, and calculatedEndTime
| Name | Type | Defined in |
|---|---|---|
calculatedEndTime | Date | shared/src/helper/workHelper/timeTrackerFunctions.ts:70 |
finalActiveSeconds | number | shared/src/helper/workHelper/timeTrackerFunctions.ts:68 |
normalizedStartTime | Date | shared/src/helper/workHelper/timeTrackerFunctions.ts:69 |