Skip to content

Commit

Permalink
Merge pull request #2949 from slozier/issue_405
Browse files Browse the repository at this point in the history
Resolve issue #405
  • Loading branch information
mramato committed Aug 18, 2015
2 parents b69af04 + 31ab731 commit a01df10
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Change Log
* Fix issue where extruded `PolygonGeometry` was always extruding to the ellipsoid surface instead of specified height.
* Fix an issue where non-feature nodes prevented KML documents from loading. [#2945](https://github.com/AnalyticalGraphicsInc/cesium/pull/2945).
* Removed [es5-shim](https://github.com/kriskowal/es5-shim), which is no longer required by the unit tests. [#2933](https://github.com/AnalyticalGraphicsInc/cesium/pull/2945)
* Fix issue where `JulianDate` would not parse certain dates properly. [#405](https://github.com/AnalyticalGraphicsInc/cesium/issues/405)

### 1.12 - 2015-08-03

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
* [Aditya Raisinghani](https://github.com/adi2412)
* [Ilia Choly](https://github.com/icholy)
* [Farouk Abdou](https://github.com/kaktus40)
* [StÈphane Lozier](https://github.com/slozier)
* [Stéphane Lozier](https://github.com/slozier)

Also see [our contributors page](http://cesiumjs.org/contributors.html) for more information.
2 changes: 1 addition & 1 deletion Source/Core/JulianDate.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ define([

var a = ((month - 14) / 12) | 0;
var b = year + 4800 + a;
var dayNumber = (((1461 * b) / 4) | 0) + (((367 * (month - 2 - 12 * a)) / 12) | 0) - (((3 * ((b + 100) / 100)) / 4) | 0) + day - 32075;
var dayNumber = (((1461 * b) / 4) | 0) + (((367 * (month - 2 - 12 * a)) / 12) | 0) - (((3 * (((b + 100) / 100) | 0)) / 4) | 0) + day - 32075;

// JulianDates are noon-based
hour = hour - 12;
Expand Down
7 changes: 7 additions & 0 deletions Specs/Core/JulianDateSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ defineSuite([
expect(julianDate.secondsOfDay).toEqual(34);
});

it('Construct a date from a JavaScript Date (5)', function() {
var jsDate = new Date('11/17/2039 12:00:00 AM UTC');
var julianDate = JulianDate.fromDate(jsDate);
expect(julianDate.dayNumber).toEqual(2466109);
expect(julianDate.secondsOfDay).toEqual(43236);
});

it('Fail to construct from an undefined JavaScript Date', function() {
expect(function() {
return JulianDate.fromDate(undefined);
Expand Down

0 comments on commit a01df10

Please sign in to comment.