This commit is contained in:
James Newton-King
2013-02-02 21:16:15 +13:00
parent 0db89bf5fa
commit 95dd0c0ba4
3 changed files with 24 additions and 3 deletions
@@ -7145,6 +7145,26 @@ Parameter name: value",
]", json);
}
[Test]
public void DateFormatStringForInternetExplorer()
{
IList<object> dates = new List<object>
{
new DateTime(2000, 12, 12, 12, 12, 12, DateTimeKind.Utc),
new DateTimeOffset(2000, 12, 12, 12, 12, 12, TimeSpan.FromHours(1))
};
string json = JsonConvert.SerializeObject(dates, Formatting.Indented, new JsonSerializerSettings
{
DateFormatString = @"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffK"
});
Assert.AreEqual(@"[
""2000-12-12T12:12:12.000Z"",
""2000-12-12T12:12:12.000+01:00""
]", json);
}
[Test]
public void JsonSerializerDateFormatString()
{