JSOO runtime fix

This commit is contained in:
Denis Merigoux 2024-05-03 09:35:20 +02:00
parent facce68b25
commit 8288754de2
No known key found for this signature in database
GPG Key ID: EE99DCFA365C3EE3

View File

@ -63,12 +63,10 @@ let date_of_js d =
let fail () = failwith "date_of_js: invalid date" in
match String.split_on_char '-' d with
| [year; month; day] -> (
match
try
R_ocaml.date_of_numbers (int_of_string year) (int_of_string month)
(int_of_string day)
with
| Some d -> d
| None -> fail ())
with Failure _ -> fail ())
| _ -> fail ()
let date_to_js d = Js.string @@ R_ocaml.date_to_string d