YARN-8592. [UI2] rmip:port/ui2 endpoint shows a blank page in windows OS and Chrome browser. Contributed by Akhil PB.
(cherry picked from commit 97870ec1f6
)
This commit is contained in:
parent
35b0686f24
commit
b1fcbe7c2d
|
@ -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);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue