Skip to content

Commit 4b79653

Browse files
authored
Merge pull request Taritsyn#60 from Gekctek/3.X
Adding timezone settings for JintEngine
2 parents 34407fd + c1404c3 commit 4b79653

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/JavaScriptEngineSwitcher.Jint/JintJsEngine.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public JintJsEngine(JintSettings settings)
8484
.MaxStatements(jintSettings.MaxStatements)
8585
.Strict(jintSettings.StrictMode)
8686
.TimeoutInterval(jintSettings.TimeoutInterval)
87+
.LocalTimeZone(jintSettings.LocalTimeZone ?? TimeZoneInfo.Local)
8788
);
8889
}
8990
catch (Exception e)

src/JavaScriptEngineSwitcher.Jint/JintSettings.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ public TimeSpan TimeoutInterval
7474
set;
7575
}
7676

77+
/// <summary>
78+
/// Gets or sets the local timezone for the dates in the script
79+
/// </summary>
80+
public TimeZoneInfo LocalTimeZone
81+
{
82+
get;
83+
set;
84+
}
85+
7786

7887
/// <summary>
7988
/// Constructs an instance of the Jint settings
@@ -86,6 +95,7 @@ public JintSettings()
8695
MaxStatements = 0;
8796
StrictMode = false;
8897
TimeoutInterval = TimeSpan.Zero;
98+
LocalTimeZone = TimeZoneInfo.Local;
8999
}
90100
}
91101
}

0 commit comments

Comments
 (0)