Skip to content

Conversation

@weiqingy
Copy link
Contributor

@weiqingy weiqingy commented Aug 10, 2016

What changes were proposed in this pull request?

This PR is to remove time inconsistency between webpages. In historypage.js, format 'Started' time, 'Completed' time and 'Last Updated' time to user local time.

How was this patch tested?

Test manually. For example:
(1) Before this PR:
The screenshot below is the application list in the history server webpage:

1

When clicking the application_1470694797714_0010, we can see its job list:

2

When clicking the job 1 (Job Id “1”), we can see the detailed information of job 1:

3

Compare the times in the three screenshots above, we could see the times in the first screenshot are not consistent with the times in the second screenshot and the third screenshot.

(2) After this PR:
After making the times showing in the history server page (historypage.js) to user local time, the first screenshot will change to:

4

Then the times in different pages will be consistent.

… Updated' time in history server UI to the user local time

… Updated' time in history server UI to the user local time
@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@rxin
Copy link
Contributor

rxin commented Aug 10, 2016

So this change can be really annoying in debugging, when we try to correlate time shown on the UI with time in logs.

@weiqingy
Copy link
Contributor Author

weiqingy commented Aug 10, 2016

Hi, @rxin . Thanks for the quick feedback. I have updated the PR description. This PR is to remove time inconsistency between webpages. Right now the times showing in history server page (which shows the application list) is inconsistent with the times showing in other pages like spark job pages (which shows the job list), that makes users confused.

@srowen
Copy link
Member

srowen commented Aug 10, 2016

Hm, I also don't quite like this change, as it's kind of hackily rewriting dates in Javascript. I am not sure this is correct, even. What does the Spark job page do to format dates? Seems like it should format dates, and format them in the same way the cluster would internally in other logs and information presentation, which would probably be the server's time zone. At least, that would surprise me less than putting it in my local time.

@weiqingy
Copy link
Contributor Author

Hi, @srowen Thanks a lot for the comments. Sorry for the late reply. You are right. I will check how other pages format the date.

@srowen
Copy link
Member

srowen commented Sep 3, 2016

I think we should not make this particular change and can close this PR. It's possible another similar change could be OK.

@ghost
Copy link

ghost commented Sep 7, 2016

HI @Sherry302 , @srowen , @rxin
this patch will make the UI not compatible with Firefox and safari;
Started time, Completed time,Last Updated time cant display right,just like that:
NAN-NAN-NAN NAN:NAN:NAN

how to sovle this problem:

var localDate = new Date((date.split(".")[0].replace("T", " ")+ " UTC").replace(/-/g,"/"));
return localDate.getFullYear() + "/" + padLeft(localDate.getMonth() + 1) + "/"
+ padLeft(localDate.getDate()) + " " + padLeft(localDate.getHours()) + ":"
+ padLeft(localDate.getMinutes()) + ":" + padLeft(localDate.getSeconds());

reference:
http://stackoverflow.com/questions/9033625/date-function-in-javascript-giving-nan-nan-nan-in-firefox-and-chrome-while-wor

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.

4 participants