Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changes for timeInterval #6493

Merged
merged 7 commits into from
Apr 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -52,6 +52,7 @@ Change Log
* Fixed crash when animating a glTF model with a single keyframe. [#6422](https://github.com/AnalyticalGraphicsInc/cesium/pull/6422)
* Fixed Imagery Layers Texture Filters Sandcastle example. [#6472](https://github.com/AnalyticalGraphicsInc/cesium/pull/6472).
* Fixed a bug causing Cesium 3D Tilesets to not clip properly when tiles were unloaded and reloaded. [#6484](https://github.com/AnalyticalGraphicsInc/cesium/issues/6484)
* Fixed `TimeInterval` so now it throws if `fromIso8601` is given an ISO 8601 string with improper formatting. [#6164](https://github.com/AnalyticalGraphicsInc/cesium/issues/6164)
* Improved rendering of glTF models that don't contain normals with a temporary unlit shader workaround. [#6501](https://github.com/AnalyticalGraphicsInc/cesium/pull/6501)
* Fixed rendering of glTF models with emissive-only materials. [#6501](https://github.com/AnalyticalGraphicsInc/cesium/pull/6501)

9 changes: 8 additions & 1 deletion Source/Core/TimeInterval.js
Original file line number Diff line number Diff line change
@@ -3,13 +3,15 @@ define([
'./defaultValue',
'./defined',
'./defineProperties',
'./DeveloperError',
'./freezeObject',
'./JulianDate'
], function(
Check,
defaultValue,
defined,
defineProperties,
DeveloperError,
freezeObject,
JulianDate) {
'use strict';
@@ -126,7 +128,9 @@ define([
};

/**
* Creates a new instance from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} interval.
* Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} interval.
*
* @throws DeveloperError if options.iso8601 does not match proper formatting.
*
* @param {Object} options Object with the following properties:
* @param {String} options.iso8601 An ISO 8601 interval.
@@ -143,6 +147,9 @@ define([
//>>includeEnd('debug');

var dates = options.iso8601.split('/');
if (dates.length !== 2) {
throw new DeveloperError('options.iso8601 is an invalid ISO 8601 interval.');
}
var start = JulianDate.fromIso8601(dates[0]);
var stop = JulianDate.fromIso8601(dates[1]);
var isStartIncluded = defaultValue(options.isStartIncluded, true);
6 changes: 6 additions & 0 deletions Specs/Core/TimeIntervalSpec.js
Original file line number Diff line number Diff line change
@@ -100,6 +100,12 @@ defineSuite([
expect(interval.data).toEqual(data);
});

it('fromIso8601 throws error when given Invalid ISO 8601 date.', function() {
expect(function() {
TimeInterval.fromIso8601({ iso8601 : '2020-08-29T00:00:00+00:00' });
}).toThrowDeveloperError();
});

it('toIso8601 works', function() {
var isoDate1 = '0950-01-02T03:04:05Z';
var isoDate2 = '0950-01-03T03:04:05Z';