esnet / esnet/pond

Creating a TimeSeries of IndexedEvent with indexes before epoch throws TypeError

Open
#236 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
211
Forks
42
PR merge metrics
No merged PRs in 30d

Description

The following code

```
const pond = require('pondjs');

const index = pond.Index.getIndexString('1d', new Date('1969-12-31')); // 1d--1
new pond.TimeSeries({columns: ['index', 'value'], points: [[index, 1]]});
```

which should be correct according to the documentation of TimeSeries, throws TypeError: Cannot read property 'begin' of undefined.

The error happens for any date before 1970-01-01, and it works correctly for any date after.
Using an index string of the form `1969-12-01` also results in the same error.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.