When I try creating a TimeInterval, the stop dates are somehow always being set to -4713-11-24T12:00:00Z. And depending on how I construct the TimeInterval, the start time is either correct or also
-4713-11-24T12:00:00Z. I added the regular Javascript Date stuff to the code below as a sanity check.
Code:
var jsStart = new Date();
var jsEnd = new Date(jsStart);
jsEnd.setHours(jsStart.getHours() + 2);
console.info("start/end: " + jsStart + "/" + jsEnd);
console.info("start/end iso8601: " + jsStart.toISOString() + "/" + jsEnd.toISOString());
var julianStart = new Cesium.JulianDate.fromDate(jsStart);
var julianEnd = new Cesium.JulianDate.fromDate(jsEnd);
console.info("start/end julian: " + julianStart + "/" + julianEnd);
var interval = new Cesium.TimeInterval({
start: julianStart,
end: julianEnd
});
console.info("interval 1: " + interval.start + " / " + interval.stop);
var interval2 = new Cesium.TimeInterval(julianStart, julianEnd);
console.info("interval 2: " + interval2.start + " / " + interval2.stop);
``
Console output:
start/end: Mon Sep 08 2014 17:02:53 GMT-0400 (Eastern Standard Time)/Mon Sep 08 2014 19:02:53 GMT-0400 (Eastern Standard Time)
start/end iso8601: 2014-09-08T21:02:53.517Z/2014-09-08T23:02:53.000Z
start/end julian: 2014-09-08T21:02:53.5169999999998254Z/2014-09-08T23:02:53Z
interval 1: 2014-09-08T21:02:53.5169999999998254Z / -4713-11-24T12:00:00Z
interval 2: -4713-11-24T12:00:00Z / -4713-11-24T12:00:00Z
``
Am I doing something wrong? Why would the method of creating the interval produce different results?