(t1, t2)
| 45 | } |
| 46 | |
| 47 | function prettyPrintTimeDifference(t1, t2) { |
| 48 | const d1 = new Date(t1), |
| 49 | d2 = new Date(t2); |
| 50 | if (isNaN(d1) || isNaN(d2)) return ["00", "00", "00"]; |
| 51 | const s = (Math.abs(d2 - d1) / 1000) | 0; |
| 52 | const hh = (s / 3600) | 0; |
| 53 | const mm = ((s % 3600) / 60) | 0; |
| 54 | const ss = s % 60; |
| 55 | return [hh, mm, ss].map((n) => String(n).padStart(2, "0")); |
| 56 | } |
| 57 | |
| 58 | function mapHourlyEventsToLocalTime(events) { |
| 59 | const now = new Date(); |