Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

global does not support getTimezoneOffset #94

Open
Sydney-o9 opened this issue Apr 25, 2017 · 0 comments
Open

global does not support getTimezoneOffset #94

Sydney-o9 opened this issue Apr 25, 2017 · 0 comments
Assignees
Labels

Comments

@Sydney-o9
Copy link

Sydney-o9 commented Apr 25, 2017

Bug

There is no support for getTimezoneOffset

Debug

The following won't return the js function.

// Easy case with simple function
$func = new Expr('function () { return -10 * 60; }');
$ob = new Highchart();
$ob->global->getTimezoneOffset($func);

This is because renderGlobal() is not setup to be rendered by 'renderWithJavascriptCallback'

Use

This is very useful because if supported, we can do the following:

$func = new Expr("function (timestamp) {
        var zone = 'Australia/Sydney',
        timezoneOffset = -moment.tz(timestamp, zone).utcOffset();

        return timezoneOffset;
}");
$ob = new Highchart();
$ob->global->getTimezoneOffset($func);

Also, this would fix #92

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants