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

Refactor julian date #1821

Merged
merged 14 commits into from
Jun 11, 2014
Merged

Refactor julian date #1821

merged 14 commits into from
Jun 11, 2014

Conversation

mramato
Copy link
Contributor

@mramato mramato commented Jun 11, 2014

  • Moved LeapSecond.leapSeconds to JulianDate.leapSeconds.
  • Refactored JulianDate to be in line with other Core types.
    • Most functions now take result parameters.
    • The default constructor no longer creates a date at the current time, use JulianDate.now() instead.
    • Removed JulianDate.getJulianTimeFraction and JulianDate.compareTo
    • new JulianDate() -> JulianDate.now()
    • date.getJulianDayNumber() -> date.dayNumber
    • date.getSecondsOfDay() -> secondsOfDay
    • date.getTotalDays() -> JulianDate.getTotalDays(date)
    • date.getSecondsDifference(arg1, arg2) -> JulianDate.getSecondsDifference(arg2, arg1) (Note, order of arguments flipped)
    • date.getDaysDifference(arg1, arg2) -> JulianDate.getDaysDifference(arg2, arg1) (Note, order of arguments flipped)
    • date.getTaiMinusUtc() -> JulianDate.getTaiMinusUtc(date)
    • date.addSeconds(seconds) -> JulianDate.addSeconds(date, seconds)
    • date.addMinutes(minutes) -> JulianDate.addMinutes(date, minutes)
    • date.addHours(hours) -> JulianDate.addHours(date, hours)
    • date.addDays(days) -> JulianDate.addDays(date, days)
    • date.lessThan(right) -> JulianDate.lessThan(left, right)
    • date.lessThanOrEquals (right) -> JulianDate.lessThanOrEquals (left, right)
    • date.greaterThan (right) -> JulianDate.greaterThan (left, right)
    • date.greaterThanOrEquals (right) -> JulianDate.greaterThanOrEquals (left, right)

mramato added 9 commits June 9, 2014 17:57
Turn all prototype functions (except for clone/equals/eqaulsEpsilon/compareTo) into static functions.
Default constructing a JulianDate no longer creates an instance set to the current time; I added JulianDate.now() for this purpose.
1. Clean up documentation.
2. Make all relevant function take result parameters.
Conflicts:
	Source/DynamicScene/SampledProperty.js
1. Removes the need for circular referneces between `LeapSecond` and `JulianDate`.
2. Moves array of leap seconds from `LeapSecond.leapSeconds` to `JulianDate.leapSeconds`
* CZML property references now use a `#` symbol to separate identifier from property path. `objectId.position` should now be `objectId#position`.
* `CesiumWidget.showErrorPanel` now takes a `message` parameter in between the previous `title` and `error` parameters.
* `Event.removeEventListener` no longer throws `DeveloperError` if the `listener` does not exist; it now returns `false`.
* Moved `LeapScond.leapSeconds` to `JulianDate.leapSeconds`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo LeapScond

@pjcozzi
Copy link
Contributor

pjcozzi commented Jun 11, 2014

CC #1407

*/
JulianDate.prototype.addMinutes = function(duration) {
JulianDate.addMinutes = function(julianDate, minutes) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the other addX functions don't actually have the result parameter that they are documented as having.

mramato added 2 commits June 11, 2014 16:34
Actually take a result parameter in function that claim to.
@mramato
Copy link
Contributor Author

mramato commented Jun 11, 2014

All pending issues have been taken care of.

shunter added a commit that referenced this pull request Jun 11, 2014
@shunter shunter merged commit adfc014 into master Jun 11, 2014
@shunter shunter deleted the refactor-julianDate branch June 11, 2014 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants