DateRangeSerializer precision issue

Description

Should_Parse_DateRange_In_JSON test fails in .NET Core 3.1 for a date range: "[0001-01-01T00:00:00.000Z TO 9999-12-31T23:59:59.999Z]"

The serializer writes a 998Z instead of 999Z because TimeSpan.TotalMilliseconds is returning 998.9xx instead of 999. We should compute this value manually and using the decimal type which will avoid the precision loss when dividing the ticks by 10000 (ticks per millisecond).

Environment

None

Assignee

Unassigned

Reporter

Joao Reis

Labels

None

Reproduced in

3.15.0

PM Priority

None

Fix versions

External issue ID

None

Doc Impact

None

Reviewer

None

Pull Request

None

Epic Link

None

Sprint

Pull Requests

None

Size

None

Priority

Major
Configure