(state: CommandState, now: Date = new Date())
| 36 | * Calculates the number of days since the first command was issued. |
| 37 | */ |
| 38 | export function daysSinceFirstCommand(state: CommandState, now: Date = new Date()): number { |
| 39 | const firstCommandDate = new Date(state.firstCommandTimestamp) |
| 40 | const diffTime = now.getTime() - firstCommandDate.getTime() |
| 41 | return Math.floor(diffTime / (1000 * 60 * 60 * 24)) |
| 42 | } |
no outgoing calls
no test coverage detected