Skip to content

Commit 5c4a109

Browse files
committed
In configuration settings of the Jint JS engine was added one new property - LocalTimeZone (default TimeZoneInfo.Local)
1 parent 956ebb1 commit 5c4a109

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

NuGet/JavaScriptEngineSwitcher.Jint/JavaScriptEngineSwitcher.Jint.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1313
<description>JavaScriptEngineSwitcher.Jint contains adapter `JintJsEngine` (wrapper for the Jint JavaScript Engine (http://github.com/sebastienros/jint) version 2.11.58).</description>
1414
<summary>JavaScriptEngineSwitcher.Jint contains adapter `JintJsEngine` (wrapper for the Jint JavaScript Engine version 2.11.58).</summary>
15-
<releaseNotes>Jint was updated to version 2.11.58.</releaseNotes>
15+
<releaseNotes>In configuration settings of the Jint JS engine was added one new property - `LocalTimeZone` (default `TimeZoneInfo.Local`).</releaseNotes>
1616
<copyright>Copyright (c) 2013-2018 Andrey Taritsyn - http://www.taritsyn.ru</copyright>
1717
<language>en-US</language>
1818
<tags>JavaScriptEngineSwitcher JavaScript ECMAScript Jint</tags>

NuGet/JavaScriptEngineSwitcher.Jint/readme.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
=============
1818
RELEASE NOTES
1919
=============
20-
Jint was updated to version 2.11.58.
20+
In configuration settings of the Jint JS engine was added one new property -
21+
`LocalTimeZone` (default `TimeZoneInfo.Local`).
2122

2223
=============
2324
DOCUMENTATION

src/JavaScriptEngineSwitcher.Jint/JintJsEngine.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ public JintJsEngine(JintSettings settings)
9797
.AllowDebuggerStatement(jintSettings.AllowDebuggerStatement)
9898
.DebugMode(jintSettings.EnableDebugging)
9999
.LimitRecursion(jintSettings.MaxRecursionDepth)
100+
.LocalTimeZone(jintSettings.LocalTimeZone ?? TimeZoneInfo.Local)
100101
.MaxStatements(jintSettings.MaxStatements)
101102
.Strict(jintSettings.StrictMode)
102103
.TimeoutInterval(TimeSpan.FromMilliseconds(jintSettings.Timeout))

src/JavaScriptEngineSwitcher.Jint/JintSettings.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace JavaScriptEngineSwitcher.Jint
1+
using System;
2+
3+
namespace JavaScriptEngineSwitcher.Jint
24
{
35
/// <summary>
46
/// Settings of the Jint JS engine
@@ -24,9 +26,18 @@ public bool EnableDebugging
2426
set;
2527
}
2628

29+
/// <summary>
30+
/// Gets or sets a local time zone for the <code>Date</code> objects in the script
31+
/// </summary>
32+
public TimeZoneInfo LocalTimeZone
33+
{
34+
get;
35+
set;
36+
}
37+
2738
/// <summary>
2839
/// Gets or sets a maximum allowed depth of recursion:
29-
/// -1 - recursion without limits;
40+
/// -1 - recursion without limits;
3041
/// N - one scope function can be called no more than N times.
3142
/// </summary>
3243
public int MaxRecursionDepth
@@ -70,6 +81,7 @@ public JintSettings()
7081
{
7182
AllowDebuggerStatement = false;
7283
EnableDebugging = false;
84+
LocalTimeZone = TimeZoneInfo.Local;
7385
MaxRecursionDepth = -1;
7486
MaxStatements = 0;
7587
StrictMode = false;

0 commit comments

Comments
 (0)