-
Type: New Feature
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 1.6
-
Component/s: Feature Request
Currently the JsonOutputMode-enum offers few different options which allows one to configure how the DateTimes are formatted with JsonWriter. To provide a better compatibility with other frameworks, it would be great if the JsonWriter could be configured to output the dates in ISO-8601 format. This format is currently the default format used by the ASP.NET Web Api: http://www.hanselman.com/blog/OnTheNightmareThatIsJSONDatesPlusJSONNETAndASPNETWebAPI.aspx
I forked the drivers and added this option in here: https://github.com/mikoskinen/mongo-csharp-driver/commit/a04fe07dd13ac8990b516e4dcdf9d9edd8fb502a
I added a new boolean UseISO8601DateFormat to JsonWriter which allows you to change the formatting. Is this a good place for it or should there be a new enum option in the JsonOutputMode? Also, I've enable the new formatting only when the flag UseISO8601DateFormat is set to true AND the JsonOutputMode is Shell. I'm not that familiar with the difference of these modes so I'm not sure if this option should be enable for others too.
- duplicates
-
CSHARP-1918 Implement Extended JSON specification
- Development Complete
- is related to
-
CSHARP-1858 Add user configurable output converters to JsonWriter
- Closed