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: [
30
30
"yojson" {>= "1.6.0"}
31
31
"resource-pooling" {>= "1.0" & < "2.0"}
32
32
"cohttp-lwt-unix"
33
+ "js_of_ocaml" {>= "5.5.0"}
33
34
"re" {>= "1.7.2"}
34
35
]
35
36
depexts: [
Original file line number Diff line number Diff line change @@ -141,14 +141,20 @@ let to_utc ?(timezone = user_tz ()) d =
141
141
142
142
let % client to_local d =
143
143
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
145
147
CalendarLib.Calendar. from_unixfloat (d -. (float o *. 60. ))
146
148
147
149
let % client to_utc d =
148
150
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
150
154
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
152
158
CalendarLib.Calendar. from_unixfloat
153
159
(if o = o'
154
160
then d' (* We guessed the DST status right *)
You can’t perform that action at this time.
0 commit comments