Skip to content

Add %z (timezone) handling in Date code. #34

Closed
wants to merge 1 commit into from

2 participants

@alokmenghrajani

This diff does not add total timezone handling (i.e. it doesn't allow you to parse the timezone from a string and/or mess around with timezone values). The main purpose of this diff is to have the ability to tell which timezone the server or client is running in, which is sometimes useful.

Alok Menghrajani Add %z (timezone) handling in Date code.
This diff does not add total timezone handling (i.e. it doesn't allow you to parse the timezone from a string and/or mess around with timezone values). The main purpose of this diff is to have the ability to tell which timezone the server or client is running in, which is sometimes useful.
90e2f5f
@alokmenghrajani

Note: I might have hit some bug with the bsl. If I try to make local_timezone_offset a nullary function, I end up with weird warnings:

opabsl/jsbsl/opabslgen_bslTime.js.pp:181: ERROR - Parse error. invalid return
return t.getTimezoneOffset();

(see https://gist.github.com/1734181).

@BourgerieQuentin
MLstate member

Alok, you have just missing ##args() on bsl register declaration.
Then I also correct Opa compile error (on date_private.opa)

see https://gist.github.com/1752783 it's just your https://gist.github.com/1734181 patch with corrections.

I commited the patch on our repository. (Sure I authored to you)

Thanks

@alokmenghrajani
@BourgerieQuentin
MLstate member
#register x \ y : 'a, 'b -> 'c

means "Register as 'x' the javascript function 'y' and it should respect the given signature ''a, 'b -> 'c'"
i.e is just like an alias.

This case is usefull when the function who want register is already defined.

In the case of 'now' indeed the implementation is just bellow the register declaration. And can be replaced by

##register now : -> time_t
##args()
{
...
}

2 -

##register x : 'a, 'b -> 'c
##args(a, b)
{
//code
}

means "Register as 'x' a javascript function with two arguments "a, b" and the following body"

Note : this way to register make some check (ex: cheking if the arity match).
And generates skeleton of javascript function.

I hope my explanations are clear enough.

Quentin.

@alokmenghrajani
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.