Skip to content

IE doesn't like items with very old dates

Saw an issue with the timeline when one of the items has a very old date, such as "0001-01-01". IE will return a invalid date at this line at getItemRange(): https://github.com/almende/vis/blob/111c9984bc4c1870d42ca96b45d90c13cb92fe0a/lib/timeline/Timeline.js#L436

Recommend changing it to this

return {
    min: min != null ? new Date(min.getTime()) : null,
    max: max != null ? new Date(max.getTime()) : null
  }

per this suggestion http://stackoverflow.com/questions/16071442/javascript-date-invalid-date-in-ie-when-copying-very-old-dates