Fix Date parsing crash when parsing a negative year (#53981)
Fixes #50328.
Originally checked on version 1.10.0 but still relevant in the current
version in master
Bug: In method Date(str), when given a negative year as an argument (ex:
"-2000"), it would output an error while in Date(int) once given a
negative year (ex: "-2000") it would work as intended returning
"-2000-01-01".
Fix: In function tryparsenext_base10 the character '-' wasn't being
accounted so i check if it existed in the first iteration of the string
and if yes I would multiply the output * -1.
Test: Added some tests that verify this specific Fix.
---------
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
Co-authored-by: Viral B. Shah <ViralBShah@users.noreply.github.com>