Fable icon indicating copy to clipboard operation
Fable copied to clipboard

System.Datetime.TryParse too forgiving in Javascript

Open HLWeil opened this issue 8 months ago • 3 comments

Description

Please provide a succinct description of your issue.

Repro code

https://fable.io/repl/#?code=DYUwLgBARgNAbhAvBAygTwM5hAWwHQAiAhtgCoCWOIepATmgApG0YgAUARAIIBCAwhABsHAJQBYAFCSADrXIA7MADN5EDgGMi8niCYsQAEwBcEAKSwIcIsACuIRKYDyHaJaA&html=Q&css=Q

let b,v = System.DateTime.TryParse("ABC 6")

printfn "canBeParsed: %b, value=%O" b v

Expected and actual results

"ABC 6" should not be parsed as a date. In DotNet and Python, as expected, the bool returned is false. In Javascript though, the bool is true and the number after the "ABC" is parsed as the month.

Related information

  • Fable version: 4.19.3
  • Operating system: Windows 11

HLWeil avatar Jun 19 '24 11:06 HLWeil