Skip to content
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

Treating slider steps with different values #115

Open
rivella50 opened this issue May 21, 2020 · 5 comments
Open

Treating slider steps with different values #115

rivella50 opened this issue May 21, 2020 · 5 comments

Comments

@rivella50
Copy link

Hi there,

i'm just wondering how i can create a slider with a step interval which does not always have the same value? For instance a date slider where the single steps should be months. Since not all months have the same amount of days the step value cannot be a certain value of millis if each slider movement would have to match the last day of each month.
Is there a solution for such a scenario or would i have to deal with it by myself (e.g. determine the last day of a month by the received ms in the onUpdate/onChange callbacks) ?

@RanSolo
Copy link

RanSolo commented May 27, 2020

There's an example of a dateslider in the readme. It uses date-fn and d3-scale's scaleTime to create the tics.

https://codesandbox.io/s/rw97j317p

@rivella50
Copy link
Author

I know that example. But here the step interval is always the same (half an hour) which doesn't answer my question.

@RanSolo
Copy link

RanSolo commented Jun 8, 2020

Well you were talking about months being a different number of days, not changing the minute intervals.

@gitp2p
Copy link

gitp2p commented Jun 11, 2020

Has anyone figured it out?

@rivella50
Copy link
Author

Nope, i solved it differently with a step interval of a day (which has of course always the same amount of millis).
@RanSolo Please read again my initial question. I was never talking about minute intervals.

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

No branches or pull requests

3 participants