File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ depends: [
3030 "yojson" {>= "1.6.0"}
3131 "resource-pooling" {>= "1.0" & < "2.0"}
3232 "cohttp-lwt-unix"
33+ "js_of_ocaml" {>= "5.5.0"}
3334 "re" {>= "1.7.2"}
3435]
3536depexts: [
Original file line number Diff line number Diff line change @@ -141,14 +141,20 @@ let to_utc ?(timezone = user_tz ()) d =
141141
142142let % client to_local d =
143143 let d = CalendarLib.Calendar. to_unixfloat d in
144- let o = (new % js Js. date_fromTimeValue (d *. 1000. ))##getTimezoneOffset in
144+ let o =
145+ (new % js Js. date_fromTimeValue (Js. float (d *. 1000. )))##getTimezoneOffset
146+ in
145147 CalendarLib.Calendar. from_unixfloat (d -. (float o *. 60. ))
146148
147149let % client to_utc d =
148150 let d = CalendarLib.Calendar. to_unixfloat d in
149- let o = (new % js Js. date_fromTimeValue (d *. 1000. ))##getTimezoneOffset in
151+ let o =
152+ (new % js Js. date_fromTimeValue (Js. float (d *. 1000. )))##getTimezoneOffset
153+ in
150154 let d' = d +. (float o *. 60. ) in
151- let o' = (new % js Js. date_fromTimeValue (d' *. 1000. ))##getTimezoneOffset in
155+ let o' =
156+ (new % js Js. date_fromTimeValue (Js. float (d' *. 1000. )))##getTimezoneOffset
157+ in
152158 CalendarLib.Calendar. from_unixfloat
153159 (if o = o'
154160 then d' (* We guessed the DST status right *)
You can’t perform that action at this time.
0 commit comments