You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[1.8>1.9] [MERGE #4318@xiaoyinl] Make Date.parse recognize padded and negative years (Fixes#4178)
Merge pull request #4318 from xiaoyinl:DateParse_zero_padded_years
This PR will finally make `Date.parse` able to parse any output of `Date.toString()`, `Date.toUTCString`, and `Date.toISOString()`.
Fixes#4178Fixes#4300
Todo:
- [x] Add, update and re-enable tests (#4300)
- [x] `new Date("2017-jan-01")` causes an assertion failure
#pragma prefast(suppress: __WARNING_INCORRECT_VALIDATION, "pch is guaranteed to be null terminated by __in_z on psz and js_memcpy_s copying the null byte")
1085
1086
for (pch = pszSrc; 0 != (ch = classifier->SkipBiDirectionalChars(pch));)
@@ -1235,6 +1236,12 @@ namespace Js {
1235
1236
goto LError;
1236
1237
}
1237
1238
lwMonth = pszs->lwVal;
1239
+
if ('-' == *pch)
1240
+
{
1241
+
// handle the case date is negative for "Thu, 23 Sep -0007 00:00:00 GMT"
0 commit comments