[ML] Fixing issue with incorrect timezones in jobs list#22714
Merged
jgowdyelastic merged 4 commits intoelastic:masterfrom Sep 5, 2018
Merged
Conversation
Contributor
|
Pinging @elastic/ml-ui |
| } | ||
|
|
||
| // if either of the dates are empty, set them to undefined | ||
| // if either of the dates are zero, set them to undefined |
Contributor
There was a problem hiding this comment.
Does this comment still apply, so that now is passed to the target page if the job has no results?
| // moment will convert undefined to now. | ||
| from = (from === '') ? undefined : from; | ||
| to = (to === '') ? undefined : to; | ||
| const fromString = moment(from).format(TIME_FORMAT); |
Contributor
There was a problem hiding this comment.
The from and to variables refer to the time in seconds, but this usage of moment expects the value in ms. Are the variables holding ms values rather than s as their name would imply?
Member
Author
There was a problem hiding this comment.
good spot. earliestTimeStampSeconds should be earliestTimeStampMs
| if (jobs.length === 1) { | ||
| from = jobs[0].earliestTimeStamp.string; | ||
| to = jobs[0].latestTimeStamp.string; | ||
| from = jobs[0].earliestTimeStampMs; |
Contributor
There was a problem hiding this comment.
Nit, but 'timestamp' is generally one word, so I think these should be earliestTimestampMs and latestTimestampMs!
Contributor
💔 Build Failed |
Member
Author
|
retest |
Contributor
💚 Build Succeeded |
jgowdyelastic
added a commit
to jgowdyelastic/kibana
that referenced
this pull request
Sep 5, 2018
* [ML] Fixing issue with incorrect timezones in jobs list * refactoring min and max calculation * changes based on review * changing TimeStamp to Timestamp
jgowdyelastic
added a commit
to jgowdyelastic/kibana
that referenced
this pull request
Sep 5, 2018
* [ML] Fixing issue with incorrect timezones in jobs list * refactoring min and max calculation * changes based on review * changing TimeStamp to Timestamp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes issue where some of the job times in the jobs list are local to the server rather than the browser.
This was caused by
momentbeing used on the server to create the time string in the jobs summary endpoint (the data used to create the table).This PR removes this server side use of moment and just passes across the epoch seconds.
The browser then runs it through moment at display time.