File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -1266,13 +1266,23 @@ namespace Js {
1266
1266
goto LError;
1267
1267
}
1268
1268
1269
- for (lwT = ch - ' 0' ; ! FBig (*pch) && isdigit (*pch) ; pch++)
1269
+ for (lwT = ch - ' 0' ; ; pch++)
1270
1270
{
1271
+ // for time zone offset HH:mm, we already got HH so skip ':' and grab mm
1272
+ if (((ss == ssAddOffset) || (ss == ssSubOffset)) && (*pch == ' :' ))
1273
+ {
1274
+ continue ;
1275
+ }
1276
+ if (FBig (*pch) || !isdigit (*pch))
1277
+ {
1278
+ break ;
1279
+ }
1271
1280
// to avoid overflow
1272
1281
if (pch - pchBase > 6 )
1273
1282
{
1274
1283
goto LError;
1275
1284
}
1285
+ // convert string to number, e.g. 07:30 -> 730
1276
1286
lwT = lwT * 10 + *pch - ' 0' ;
1277
1287
}
1278
1288
@@ -1292,6 +1302,7 @@ namespace Js {
1292
1302
1293
1303
if (lwNil != lwOffset)
1294
1304
goto LError;
1305
+ // convert into minutes, e.g. 730 -> 7*60+30
1295
1306
lwOffset = lwT < 24 ? lwT * 60 :
1296
1307
(lwT % 100 ) + (lwT / 100 ) * 60 ;
1297
1308
if (ssSubOffset == ss)
Original file line number Diff line number Diff line change @@ -19,13 +19,15 @@ Invalid Date
19
19
Invalid Date
20
20
21
21
0001-01-01T01:01:01.001+25:00
22
- Invalid Date
22
+ 0000-12-31T00:01:01.001Z
23
+ -62135683138999 === -62135683138999
23
24
24
25
0001-01-01T01:60:01.001Z
25
26
Invalid Date
26
27
27
28
0001-01-01T01:01:01.001+00:60
28
- Invalid Date
29
+ 0001-01-01T00:01:01.001Z
30
+ -62135596738999 === -62135596738999
29
31
30
32
0001-01-01T01:01:60.001Z
31
33
Invalid Date
@@ -39,8 +41,8 @@ Invalid Date
39
41
Invalid Date
40
42
41
43
Total: 11
42
- Accepted: 0
43
- Rejected: 11
44
+ Accepted: 2
45
+ Rejected: 9
44
46
Failed: 0
45
47
46
48
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
You can’t perform that action at this time.
0 commit comments