Browse Source

Fixed #1527: error when creating/updating a Timeline without data

codeClimate
jos 8 years ago
parent
commit
4cae296b17
2 changed files with 4 additions and 3 deletions
  1. +2
    -1
      HISTORY.md
  2. +2
    -2
      lib/timeline/Timeline.js

+ 2
- 1
HISTORY.md View File

@ -4,8 +4,9 @@ http://visjs.org
## not yet released, version 4.11.1-SNAPSHOT
### Timeline
- Fixed #1527: error when creating/updating a Timeline without data.
## 2015-12-18, version 4.11.0

+ 2
- 2
lib/timeline/Timeline.js View File

@ -379,8 +379,8 @@ Timeline.prototype.fit = function (options) {
Timeline.prototype.getItemRange = function () {
// get a rough approximation for the range based on the items start and end dates
var range = this.getDataRange();
var min = range.min.valueOf();
var max = range.max.valueOf();
var min = range.min !== null ? range.min.valueOf() : null;
var max = range.max !== null ? range.max.valueOf() : null;
var minItem = null;
var maxItem = null;

Loading…
Cancel
Save