New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The pointIntervalUnit option should cover days to be used on DST crossover #4958

Closed
TorsteinHonsi opened this Issue Jan 26, 2016 · 4 comments

Comments

Projects
None yet
4 participants
@TorsteinHonsi
Collaborator

TorsteinHonsi commented Jan 26, 2016

Otherwise, there is no way to put daily points.

Demo: http://jsbin.com/togajuguwa/edit?html,js,output.

Expected this to work:

series: {
    pointStart: 1445641200000,
    pointInterval: 1,
    pointIntervalUnit: 'day'
}
@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Jan 26, 2016

Collaborator

Work in progress

In the autoIncrement function, I replaced the block handling pointIntervalUnit with the following. It then supports day, but we're only half way to the solution because it doesn't take getTimezoneOffset into account:

        if (pointIntervalUnit) {
            date = new Date(xIncrement);
            if (pointIntervalUnit === 'day') {
                date = +date[setDate](date[getDate]() + pointInterval);
            } else if (pointIntervalUnit === 'month') {
                date = +date[setMonth](date[getMonth]() + pointInterval);
            } else if (pointIntervalUnit === 'year') {
                date = +date[setFullYear](date[getFullYear]() + pointInterval)
            }
            pointInterval = date - xIncrement - getTZOffset(xIncrement);
        }
Collaborator

TorsteinHonsi commented Jan 26, 2016

Work in progress

In the autoIncrement function, I replaced the block handling pointIntervalUnit with the following. It then supports day, but we're only half way to the solution because it doesn't take getTimezoneOffset into account:

        if (pointIntervalUnit) {
            date = new Date(xIncrement);
            if (pointIntervalUnit === 'day') {
                date = +date[setDate](date[getDate]() + pointInterval);
            } else if (pointIntervalUnit === 'month') {
                date = +date[setMonth](date[getMonth]() + pointInterval);
            } else if (pointIntervalUnit === 'year') {
                date = +date[setFullYear](date[getFullYear]() + pointInterval)
            }
            pointInterval = date - xIncrement - getTZOffset(xIncrement);
        }
@PaulDalek

This comment has been minimized.

Show comment
Hide comment
@PaulDalek

PaulDalek Nov 9, 2017

Contributor

+1

Contributor

PaulDalek commented Nov 9, 2017

+1

2 similar comments
@Denyllon

This comment has been minimized.

Show comment
Hide comment
@Denyllon

Denyllon Nov 9, 2017

Contributor

+1

Contributor

Denyllon commented Nov 9, 2017

+1

@droiddk

This comment has been minimized.

Show comment
Hide comment
@droiddk

droiddk commented Nov 13, 2017

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment