Closed haacked closed 11 years ago
definitely need to update the docs. for now added outdated warning.
virtual
method is a great idea too. the more difficult this becomes the better it is for now. this will sort of force users to use iso8601 format. haven't had any requests yet. so will leave it unless someone actually needs it.
The ISO8601 support was only added when mvc4(json.net) decided to default to iso8601. glad that at this problem has been solved in .net now.
what about serialization?
Serialization? Oh yeah. One sec.
Done. :)
last one. need tests for DateTimeOffset?
too.
sample for DateTime?
.
https://github.com/facebook-csharp-sdk/simple-json/blob/261f26937173bf263825e8500f5b6f2055514ccf/src/SimpleJson.Tests/PocoDeserializerTests/NullableTypeDeserializeTests.cs#L64-L88 https://github.com/facebook-csharp-sdk/simple-json/blob/261f26937173bf263825e8500f5b6f2055514ccf/src/SimpleJson.Tests/PocoJsonSerializerTests/NullableSerializeTests.cs#L54-L61
Done!
Done. Sorry about that. Trying to do 10 things at once. ;)
Adding support for DateTimeOffset.
Also note that this wiki page: https://github.com/facebook-csharp-sdk/simple-json/wiki/Date-and-Time-Formats seems to be out of date. simple-json does support
DateTime
. At least the Poco serialization strategy does. It assumes ISO8601 (good choice!).You might want to add a virtual method that allows a strategy to choose a different date format later. :)