mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-08 07:51:43 +03:00
JSOO runtime fix
This commit is contained in:
parent
facce68b25
commit
8288754de2
@ -63,12 +63,10 @@ let date_of_js d =
|
|||||||
let fail () = failwith "date_of_js: invalid date" in
|
let fail () = failwith "date_of_js: invalid date" in
|
||||||
match String.split_on_char '-' d with
|
match String.split_on_char '-' d with
|
||||||
| [year; month; day] -> (
|
| [year; month; day] -> (
|
||||||
match
|
try
|
||||||
R_ocaml.date_of_numbers (int_of_string year) (int_of_string month)
|
R_ocaml.date_of_numbers (int_of_string year) (int_of_string month)
|
||||||
(int_of_string day)
|
(int_of_string day)
|
||||||
with
|
with Failure _ -> fail ())
|
||||||
| Some d -> d
|
|
||||||
| None -> fail ())
|
|
||||||
| _ -> fail ()
|
| _ -> fail ()
|
||||||
|
|
||||||
let date_to_js d = Js.string @@ R_ocaml.date_to_string d
|
let date_to_js d = Js.string @@ R_ocaml.date_to_string d
|
||||||
|
Loading…
Reference in New Issue
Block a user