Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[fix] stdlib: local_timezone_offset doesn't need a time as argument

  • Loading branch information...
commit 54c057781785f6dd0869768d89caf9235aba10af 1 parent 14af0ab
Alok Menghrajani authored BourgerieQuentin committed
View
6 opabsl/jsbsl/bslTime.js
@@ -159,10 +159,10 @@ function now()
return t.getHours();
}
-##register local_timezone_offset : time_t -> int
- ##args(f)
+##register local_timezone_offset : -> int
+ ##args()
{
- var t = new Date(); t.setTime(f)
+ var t = new Date();
return t.getTimezoneOffset();
}
View
2  opabsl/mlbsl/bslTime.ml
@@ -83,7 +83,7 @@
##register local_hour : time_t -> int
let local_hour t = Time.local_hour (wrap t)
- ##register local_timezone_offset : time_t -> int
+ ##register local_timezone_offset : -> int
let local_timezone_offset _ = Time.local_timezone_offset()
##register local_mday : time_t -> int
View
3  stdlib/core/date/date.opa
@@ -432,8 +432,7 @@ type time_t = external
* @return The local timezone (+hhmm or -hhmm).
**/
get_local_timezone : -> string = -> (
- t : Date.date = Date.now()
- delta : int = Date_private.time_local_timezone_offset(t)
+ delta : int = Date_private.time_local_timezone_offset()
// delta is the timezone in minutes, so we need to convert it into
// +hhmm or -hhmm. If delta is positive, the timezone is -hhmm. Otherwise
// the timezone is +hhmm.
View
4 stdlib/core/date/date_private.opa
@@ -105,8 +105,8 @@ import stdlib.core.parser
time_local_hour : Date.date -> int =
date_in(%%BslTime.local_hour%% : time_t -> int) // Hours 0..23
- time_local_timezone_offset : Date.date -> int =
- date_in(%%BslTime.local_timezone_offset%% : time_t -> int)
+ time_local_timezone_offset : -> int =
+ %%BslTime.local_timezone_offset%% : -> int
time_local_mday : Date.date -> int =
date_in(%%BslTime.local_mday%% : time_t -> int) // Day of month 1..31

0 comments on commit 54c0577

Please sign in to comment.
Something went wrong with that request. Please try again.