Skip to content

Commit

Permalink
fix: Adjust for TZ environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Sep 18, 2022
1 parent 9cd084d commit 29235f8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Uno.Wasm.Bootstrap/ts/Uno/WebAssembly/Bootstrapper.ts
Expand Up @@ -175,11 +175,22 @@ namespace Uno.WebAssembly.Bootstrap {
}
}

this.timezonePreSetup();

if (LogProfilerSupport.initializeLogProfiler(this._unoConfig)) {
this._logProfiler = new LogProfilerSupport(this._context, this._unoConfig);
}
}

private timezonePreSetup() {
let timeZone = 'UTC';
try {
timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
// eslint-disable-next-line no-empty
} catch { }
this._monoConfig.environmentVariables['TZ'] = timeZone || 'UTC';
}

private RuntimeReady() {
MonoRuntimeCompatibility.initialize();

Expand Down

0 comments on commit 29235f8

Please sign in to comment.