(startDate: Date, endDate: Date)
| 217 | } |
| 218 | |
| 219 | export function getAllowedUnits(startDate: Date, endDate: Date) { |
| 220 | const units = ['minute', 'hour', 'day', 'month', 'year']; |
| 221 | const minUnit = getMinimumUnit(startDate, endDate); |
| 222 | const index = units.indexOf(minUnit); |
| 223 | |
| 224 | return index >= 0 ? units.splice(index) : []; |
| 225 | } |
| 226 | |
| 227 | /** |
| 228 | * fork from https://github.com/mcnaveen/numify/blob/main/src/index.ts |
no test coverage detected