YARN-8592. [UI2] rmip:port/ui2 endpoint shows a blank page in windows OS and Chrome browser. Contributed by Akhil PB.
This commit is contained in:
parent
1ea81169ba
commit
97870ec1f6
|
@ -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