Problem:
Integrating with Salesforce API’s and they don’t support the full ISO8601 standard, they return an overflow error when the milliseconds are included
I know I can override the global datetime format serialization using the following custom format string but if possible I’d prefer to limit the vendor specific stuff to a JSConfig scope but so far have not found a way to use a custom format string within a scope. Is this possible?
var dateTimeFormatString = "yyyy-MM-ddTHH:mm:ssZ";
JsConfig<DateTime>.SerializeFn = time => time.ToUniversalTime().ToString(dateTimeFormatString);
JsConfig<DateTime?>.SerializeFn = time => time?.ToUniversalTime().ToString(dateTimeFormatString);