From 8acd55e18a5b72e9b3e361728138f6f761addc5d Mon Sep 17 00:00:00 2001 From: Marko Lahma Date: Thu, 23 Nov 2023 18:18:56 +0200 Subject: [PATCH] test y --- Jint/Native/Date/DatePrototype.cs | 2 +- Jint/Options.cs | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Jint/Native/Date/DatePrototype.cs b/Jint/Native/Date/DatePrototype.cs index 070fdc0bfe..68459a1f9e 100644 --- a/Jint/Native/Date/DatePrototype.cs +++ b/Jint/Native/Date/DatePrototype.cs @@ -1404,7 +1404,7 @@ private string TimeZoneString(DatePresentation tv) var offsetMin = MinFromTime(absOffset).ToString("00", CultureInfo.InvariantCulture); var offsetHour = HourFromTime(absOffset).ToString("00", CultureInfo.InvariantCulture); - var tzName = " (" + TimeZoneInfo.Local.StandardName + ")"; + var tzName = " (" + _timeSystem.DefaultTimeZone.StandardName + ")"; return offsetSign + offsetHour + offsetMin + tzName; } diff --git a/Jint/Options.cs b/Jint/Options.cs index 7c5a119e9d..56cf46bcad 100644 --- a/Jint/Options.cs +++ b/Jint/Options.cs @@ -22,9 +22,10 @@ namespace Jint public class Options { private static readonly CultureInfo _defaultCulture = CultureInfo.CurrentCulture; - private static readonly TimeZoneInfo _defaultTimeZone = TimeZoneInfo.Local; private ITimeSystem? _timeSystem; + private TimeZoneInfo? _timeZone; + internal List> _configurations { get; } = new(); /// @@ -75,7 +76,11 @@ public ITimeSystem TimeSystem /// /// The time zone the engine runs on, defaults to local. Same as setting DefaultTimeSystem with the time zone. /// - public TimeZoneInfo TimeZone { get; set; } = _defaultTimeZone; + public TimeZoneInfo TimeZone + { + get => _timeZone ??= TimeZoneInfo.Local; + set => _timeZone = value; + } /// /// Reference resolver allows customizing behavior for reference resolving. This can be useful in cases where