Scoped datetime serialization

Integrating with Salesforce API’s and they don’t support the full ISO8601 standard, they return an overflow error when the milliseconds are included :man_facepalming:

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);

You can’t specify a custom format but you can specify a DateHandler within a scope configuration, either in code using a HttpResult scope or on the query string with ?jsconfig.