Skip to content

improved the date range selector and fixed #54 #60 #64

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

Merged
merged 8 commits into from Feb 4, 2021
Merged

improved the date range selector and fixed #54 #60 #64

merged 8 commits into from Feb 4, 2021

Conversation

ghost
Copy link

@ghost ghost commented Feb 2, 2021

this PR fixes #54 and #60
any remarks about the code or the comments let me know
I tested the functionality before this pr but if something isn't working open an issue or mention it here so I can fix it

@Rperry2174
Copy link
Contributor

Hey @Abaali I like this solution a lot! There are a couple of UI/UX things that I think would make it better, however I'm not sure if they are all possible.

Improvement 1

We should change the date formate to be YYYY-mm-dd HH:MM
image

2021-19-01 04:30 PM --> 2021-01-19 04:30 PM
2021-10-02 04:55 PM --> 2021-02-10 04:55 PM

Improvement 2

This one is a little trickier, but I think if we use these date pickers that select a range we have to have it affect both dates.

Is it possible to make just one daterange selector affect both start date and end date? Right now its confusing because when you move the mouse around while selecting an end date, it seems like you are selecting a full range because a full range gets highlighted.

Here's a gif where I'm only adjusting the start date, but when I change the start date from the Jan 15 to Jan 1, it looks as if I'm changing the full range to be:
from: January 1, 2020 to January 15, 2020.

Do you think we could get ours to function more like this one?

@ghost
Copy link
Author

ghost commented Feb 3, 2021

@LouisInFlow I added some small changes

  • changed the date format
  • from selector doesn't look like you are changing the whole range anymore

the selector can be changed to look like the one you mentioned, but it will need a little work. So I suggest merging this PR to solve the current issues until we find a better way to implement it.
there is a good package that we can use but it will need some CSS customization here an example of how it looks:

Screenshot from 2021-02-03 12-21-42

if you or someone else can handle the CSS part, then I can change the package we are using now with this one.

@Rperry2174
Copy link
Contributor

Rperry2174 commented Feb 3, 2021

Hey @Abaali the thing stopping us from merging this version is that the UI/UX is actually more confusing than the version before. The reason why, is because in this version there are two colors, Grey and Blue... The problem is that these colors don't consistently mean something.

In the example I linked the meaning of the colors is very straightforward:

  • If a date is "blue" then that date is part of the selected date range state. The color is a function of what date range is selected

In the version from this pr:

  • If a date is "blue" then that actually doesn't necessarily mean anything. It actually flickers depending on wherever your mouse is hovering. It is therefore a function of where your mouse is hovering (which is more confusing than useful)
  • if a date is "grey" then that means that it is part of the selected range UNLESS you move your mouse around and then even the selected range will sometimes turn blue depending on where your mouse is which then makes it hard to see which dates are part of the selected range

2021-02-03 10 31 51

Here is what I propose in order to merge this PR:

  • Make the current selected range be blue instead of the light grey that it currently is
  • Remove the light grey color totally

So this:

  • removes the "on hover" coloring so that the "flickering" stops
  • Only colors a date as Blue when someone clicks and that date is a part of the date range

One more example:
Here the dates February 1 - February 11 should be blue instead of grey because those are the selected time range.
image

And here the dates February 12 - February 26 should just be normal white UNTIL the user clicks:
image

Then after the user clicks the range should look like this picture except the range February 1 through February 26 should be blue instead of grey:
image

Does that make sense?

@ghost
Copy link
Author

ghost commented Feb 3, 2021

I worked on a quick solution check it out

@Rperry2174
Copy link
Contributor

Hey @Abaali yeah this is great! If you can resolve the conflicts then we can merge this

@ghost
Copy link
Author

ghost commented Feb 3, 2021

conflicts resolved! :)

@Rperry2174 Rperry2174 merged commit 8ec591d into grafana:main Feb 4, 2021
@Rperry2174
Copy link
Contributor

Thanks for this @Abaali Pyroscope's whole flow is much smoother thanks to your last couple PRs 🙌🏾

@ghost
Copy link
Author

ghost commented Feb 4, 2021

You're welcome 😄

korniltsev pushed a commit that referenced this pull request Jul 18, 2023
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

Successfully merging this pull request may close these issues.

Alert user with text if startDate > endDate
1 participant