react-compound-slider
react-compound-slider copied to clipboard
Treating slider steps with different values
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) ?
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
I know that example. But here the step interval is always the same (half an hour) which doesn't answer my question.
Well you were talking about months being a different number of days, not changing the minute intervals.
Has anyone figured it out?
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.