Rollup with Moment duration or certain duration factory methods generates error
- Dominant language
- TypeScript
- Stars
- 211
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
The happy path works:
```
series.fixedWindowRollup({
window(duration('1h')),
aggregation: {v_sum: ['v', sum()]}
})
```
However, the following does not work, and generates `TypeError: Cannot read property 'mid' of undefined`:
```
series.fixedWindowRollup({
window(duration(moment.duration(1, 'h'))),
aggregation: {v_sum: ['v', sum()]}
})
```
Other variants have issues too:
```
duration(moment.duration(1, 'h').asMilliseconds())
```
But, if you hack the `_string` property, it works!
```
const d = duration(moment.duration(1, 'h').asMilliseconds())
d._string = '1h' // Normally is PT1H when moment is used
```
So it seems that rollups are sensitive to the string property?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.