Repository: hadoop Updated Branches: refs/heads/trunk 1ea81169b -> 97870ec1f
YARN-8592. [UI2] rmip:port/ui2 endpoint shows a blank page in windows OS and Chrome browser. Contributed by Akhil PB. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/97870ec1 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/97870ec1 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/97870ec1 Branch: refs/heads/trunk Commit: 97870ec1f6e40ee863333f29411d71b6c687bbed Parents: 1ea8116 Author: Sunil G <sun...@apache.org> Authored: Thu Aug 2 16:10:54 2018 +0530 Committer: Sunil G <sun...@apache.org> Committed: Thu Aug 2 16:10:54 2018 +0530 ---------------------------------------------------------------------- .../src/main/webapp/app/utils/date-utils.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/97870ec1/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/date-utils.js ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/date-utils.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/date-utils.js index 6a9780c..4abdc72 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/date-utils.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/date-utils.js @@ -16,12 +16,18 @@ * limitations under the License. */ - const defaultTz = "America/Los_Angeles"; const getDefaultTimezone = () => { - return moment.tz.guess() || defaultTz; + let timezone = defaultTz; + try { + timezone = moment.tz.guess(); + } catch (e) { + console.log(e); + } + return timezone || defaultTz; }; -export const convertTimestampWithTz = (timestamp, format = "YYYY/MM/DD") => - moment.tz(parseInt(timestamp), getDefaultTimezone()).format(format); +export const convertTimestampWithTz = (timestamp, format = "YYYY/MM/DD") => { + return moment.tz(parseInt(timestamp), getDefaultTimezone()).format(format); +}; --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org