(timeEntries: TimeEntry[])
| 184 | * Get the active (running) time entry for a task |
| 185 | */ |
| 186 | export function getActiveTimeEntry(timeEntries: TimeEntry[]): TimeEntry | null { |
| 187 | if (!timeEntries || !Array.isArray(timeEntries)) { |
| 188 | return null; |
| 189 | } |
| 190 | |
| 191 | return timeEntries.find((entry) => entry.startTime && !entry.endTime) || null; |
| 192 | } |
| 193 | |
| 194 | /** |
| 195 | * Format time in minutes to a readable string (e.g., "1h 30m", "45m") |
no outgoing calls