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

Forward and BackWard or play fails on edges conditions #12

Open
mitrin359 opened this issue Feb 22, 2017 · 2 comments
Open

Forward and BackWard or play fails on edges conditions #12

mitrin359 opened this issue Feb 22, 2017 · 2 comments

Comments

@mitrin359
Copy link

In forward or play
on the edge case (i.e., near scope.starting side), from second turn onwards, if the size to be selected is less than getBrushSize, then it is skipping the first size(scope.start to scope.start(ceil)) to be selected and moving on with the next size.

In Backward
Similar to above but reverse,
on the edge case (i.e., near scope.end side), from second turn onwards, if the size to be selected is less than getBrushSize, then it is skipping that last size(scope.end(floor) to scope.end) to be selected and moving on with the next size.

Example : if current time is Feb, 2017 and we select last 5 years and year in drop down of timeslider,
and checking for backward button the above backward issue arises, similarly for forward or play when current time is over June.

Solution is editing
"kibana-5.1.2-linux-x86_64/plugins/kibana-time-plugin/public/lib/bootstrap-addons/dist/js/bootstrap-addons.js

In scope.stepBack function
Change
nextStart = new Date(scope.end.getTime() - getBrushSize());
to
nextStart = scope.end;

and

In scope.stepForward function
Change
nextStop = new Date(scope.start.getTime() + getBrushSize());
to
nextStop = scope.start;

I hope above changes doesn't hurt any other functioning, if I'm wrong please correct me.

@nreese
Copy link
Owner

nreese commented Feb 22, 2017

Thanks for the detailed description with good test conditions.

I was able to recreate the problem. The problem occurred when the brush extent gets rounded to snap the extent to the desired size. The rounding caused that missing time fragment.

I have pushed a change to master that should solve the problem. Reinstall the plugin by cloning master under KIBANA_HOME/plugins and test the change out. Let me know if that did the trick.

@mitrin359
Copy link
Author

Hi Sorry for taking so many days to comment.
Now its not skipping but, its taking more than it should,
for example for a year wise brush, think if current month is march, & we selected last 3 years, in brushend side we will have only 3 months for 2017.
so when we click back it will select jan 2016 to march 2017, but I think that it should be jan 2017 to march 2017, and this will be similar but viceversa on the frond side if we are in november etc.

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

2 participants