Commit e8f04f0
fix(js/ts): reject JS-permissive date strings that .NET TryParse rejects
V8's Date constructor accepts strings like "ABC 6" by treating the
letter sequence as a timezone abbreviation. .NET DateTime.TryParse
rejects such strings as invalid.
Add a pre-validation check in parseRaw() that requires the input to
start with a digit or a recognised month-name prefix (Jan–Dec).
This matches .NET behaviour while preserving all existing valid formats.
Closes #3858
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 2d9673f commit e8f04f0
2 files changed
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
599 | 599 | | |
600 | 600 | | |
601 | 601 | | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
602 | 611 | | |
603 | 612 | | |
604 | 613 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
876 | 876 | | |
877 | 877 | | |
878 | 878 | | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
879 | 893 | | |
880 | 894 | | |
881 | 895 | | |
| |||
0 commit comments