-Added DateParseHandling

This commit is contained in:
James Newton-King
2012-04-19 00:02:11 +12:00
parent 10256fcf68
commit 852a980659
13 changed files with 207 additions and 14 deletions
+11
View File
@@ -111,6 +111,7 @@ namespace Newtonsoft.Json
private DateTimeZoneHandling _dateTimeZoneHandling;
private int? _maxDepth;
private bool _hasExceededMaxDepth;
internal DateParseHandling _dateParseHandling;
/// <summary>
/// Gets the current reader state.
@@ -151,6 +152,15 @@ namespace Newtonsoft.Json
set { _dateTimeZoneHandling = value; }
}
/// <summary>
/// Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON.
/// </summary>
public DateParseHandling DateParseHandling
{
get { return _dateParseHandling; }
set { _dateParseHandling = value; }
}
/// <summary>
/// Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a <see cref="JsonReaderException"/>.
/// </summary>
@@ -237,6 +247,7 @@ namespace Newtonsoft.Json
_currentState = State.Start;
_stack = new List<JsonPosition>(4);
_dateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind;
_dateParseHandling = DateParseHandling.DateTime;
CloseInput = true;
}