-
Notifications
You must be signed in to change notification settings - Fork 11
Create DateRangePicker component #575
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@crisalbu I have a rough draft of the DateRangePicker up here. It's missing some of the functionality like the range showing in the date input, but I wanted to get it out in front of you so I could get your feedback on some of the interactions that aren't described in the designs:
|
2353ed5
to
cfa34df
Compare
cfa34df
to
9e01cfe
Compare
@crisalbu I think I've implemented all the designs and your feedback. You can see an example here. Let me know what you think. One thing to note: when a start date is selected but an end date isn't, the designs have end date in the same color as the placeholder. That currently isn't possible without changing some deeper code. If that's a hard requirement, let me know and I can get to work on that. Instead, the input text is all the same default color. |
Hey @hoorayimhelping , unfortunately I cannot pick a date, is that expected?
It needs to be different colours, I'm afraid, to signal/emphasise where a the date has already been selected and where not. |
@crisalbu no, that's not expected. I just tested it in Chrome and I can't pick one either. Very odd, it works fine in Firefox. I'll figure this one out.
Okay. This is something that will block the DateRangePicker from being shipped until I can figure out a workaround. |
9e01cfe
to
098898a
Compare
@crisalbu It's working in Chrome again, and the placeholder text should now be the proper color when a start date is selected and an end date isn't. Let me know if there are any other changes that need to happen. Preview here: https://click-ui-git-bucky-datetimepicker-clickhouse.vercel.app/?path=/docs/display-daterangepicker--docs |
Thanks @hoorayimhelping , I was able to test. I also uncovered a small bug. Currently, you can't seem to select a new interval, once one was selected, see video below: Expected behaviour:
|
@crisalbu I thought that was the intended behavior we wanted based on your earlier comment, but I can see how I'd interpret it differently now. Before I change this, I figured I'd make the case for why it's this way: You can still reset the interval if you click the start date after clearing the end date. I personally prefer the way it is now, because it allows you to change the end date without resetting the whole date range. This is nice in the case of accidentally clicking the wrong date, or in the case where you want to change the end date and your start date is in a different month. It saves having to click back through to the appropriate month and selecting the start date again. I find resetting the whole range after clicking on either date a bit annoying when using date pickers in the wild. But if you feel strongly that clicking either the start date or the end date should reset the whole range, I can do that. |
But how do I clear the date? I wasn’t able to do that. The UI only allowed me to select a new end date, never a new start date. In most tools (like Datadog, Booking, or Google Flights), the behavior is as follows:
If we don’t follow that (which, to me, is familiar and expected behavior), we should at least:
|
Click end date, then click start date. 1.movAlternatively, click start date, then end date: 1.mov
cool, I can do that, regardless of what we decide to go with |
I'm afraid that's not a common pattern and many users won't realize that's how it's done. I'd prefer it if we reset the date on click. If we want to make the date picker more complex, we can let users click the start/end date in the in the field (not the drop-down calendar) which would let users select a new start/end date. Hope that makes sense, if not, let's jump on a call :) |
@crisalbu all previous issues you've brought up have been resolved. Latest build for testing: https://click-12z4pwk0z-clickhouse.vercel.app/?path=/docs/display-daterangepicker--docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome, thanks @hoorayimhelping ❤️
In a future addition, it would be nice if we could let users delete the start or end date when pressing it in the text field.
Nevermind. It's actually quite difficult with Radix. |
…ing colors of the placeholder
dab89be
to
a90314e
Compare
4333f47
to
a3d58ff
Compare
Creates a
DateRangePicker
component which allows us to, you guessed it, pick date ranges.onSelectDateRange
which is a callback function that is called when the date range is selected (i.e. after the end date has been selected). The callback has two arguments,startDate
andendDate
, both of typeDate
.startDate
and/orendDate
so that they're automatically selected when theDateRangePicker
is renderedDatePicker
start date - end date
Video:
1.mov