Skip to content

Commit 6b95f18

Browse files
author
Marco Ancona
authored
Update TimeZoneDefinition.ts
Parse TimeZoneInfo as a fallback to simple timezone mapping
1 parent ef1ff64 commit 6b95f18

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/js/ComplexProperties/TimeZones/TimeZoneDefinition.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,13 @@ export class TimeZoneDefinition extends ComplexProperty {
290290
this.Validate();
291291

292292
if (!parse) {
293-
//ref: skipped creation based on server data, directly creating using TimeZone Mapping data. complex to translate Windows TimeZoneInfo subclasses to javascript.
294-
return TimeZoneInfo.FindSystemTimeZoneById(this.Id);
293+
try {
294+
//ref: skipped creation based on server data, directly creating using TimeZone Mapping data. complex to translate Windows TimeZoneInfo subclasses to javascript.
295+
return TimeZoneInfo.FindSystemTimeZoneById(this.Id);
296+
}
297+
catch {
298+
EwsLogging.DebugLog(`Could not resolve a system timezone with Id "${this.Id}"`);
299+
}
295300
}
296301
let result: TimeZoneInfo;
297302

0 commit comments

Comments
 (0)