(series: Series[], from: string, to: string)
| 66 | } |
| 67 | |
| 68 | function pctChange(series: Series[], from: string, to: string): number | null { |
| 69 | const start = closeOn(series, from); |
| 70 | const end = closeOn(series, to); |
| 71 | if (start == null || end == null || start === 0) return null; |
| 72 | return ((end - start) / start) * 100; |
| 73 | } |
| 74 | |
| 75 | function addDays(date: string, days: number): string { |
| 76 | const d = new Date(date + "T00:00:00Z"); |
no test coverage detected