(timeRange: TimeRange, endDate?: string)
| 107 | * @returns Date object for the end of the range, or null for preset ranges |
| 108 | */ |
| 109 | export function getEndDateFromTimeRange(timeRange: TimeRange, endDate?: string): Date | null { |
| 110 | if (timeRange !== 'Custom range') return null |
| 111 | |
| 112 | if (endDate) { |
| 113 | const date = new Date(endDate) |
| 114 | if (!endDate.includes('T')) { |
| 115 | date.setHours(23, 59, 59, 999) |
| 116 | } else { |
| 117 | date.setMilliseconds(999) |
| 118 | } |
| 119 | return date |
| 120 | } |
| 121 | |
| 122 | return null |
| 123 | } |
| 124 | |
| 125 | type ComparisonOperator = '=' | '>' | '<' | '>=' | '<=' | '!=' |
| 126 |
no outgoing calls
no test coverage detected