tremor
tremor copied to clipboard
Only select single day in Datepicker
The Datepicker component seems to only allow date ranges, is it currently possible to set it to selecting a single date?
If it's okay to have also the range selection, then it's already possible to choose only one date.
32f4e654-023a-4b5b-8238-1dcebd9080a8.webm
If not, I think the DatePicker
component needs to be updated with a new attribute single
or something like this.
Okay great! That's definitely a workaround for now, thank you! For future it would be nice indeed to block the option of selecting a range if the goal output is always a single date.
I agree, its a great date picker but in certain circumstance I'd like to use it for just choosing a single date to filter daily graphs
It seems the handleSelect does not get triggered when selecting a single day. It only gets triggered when selecting a range.
Hi all, thanks for providing all the feedback! In a dashboard context we believe a date range picker as it is implemented currently makes more sense, since data is always filtered for a time window rather than a single point in time. Now: in the near future we aim to extend the Datepicker component with the ability to filter for time ranges as well, which will effectively allow to select a single date. Let us know what you think :)
What's the difference between time windows and time ranges you mentioned? @mitrotasios
Sorry that wasn't clear. What I mean is that we want to allow filtering for time ranges and not only for dates as it is currently the case. (e.g. 2022-10-10 12:00 to 2022-10-10 19:00)
Okay, that would be a nice addition. But in terms of selecting individual days, wouldn't it be quite cumbersome to select "01-11-2022 0:00 to 01-11-2022 23:59" to select a single day? I'd like to see a built-in shortcut that, for example, selects that time span by default when you click on a single day, and then you could select custom hours after that
Okay, that would be a nice addition. But in terms of selecting individual days, wouldn't it be quite cumbersome to select "01-11-2022 0:00 to 01-11-2022 23:59" to select a single day? I'd like to see a built-in shortcut that, for example, selects that time span by default when you click on a single day, and then you could select custom hours after that
I agree with @eykrehbein . I guess if you're looking at it purely for graphs, a single day wouldn't make much sense but for a lot of other implementations selecting a single day is exactly what you want to do and doing it through the hassle of selecting a to and from that are on the same day seems unnecessary.
Also here to 👍 this feature request. To give a concrete use case, we have a number of charts in a dashboard that are looking at WoW data at day-level granularity. For example our default view is to show yesterday's data (for example Saturday) and then compare that to the previous 6 Saturdays data. Comparison at a longer date range simply isn't valuable given the type of data we're comparing and we aren't day-parting our data so looking at it as a time range doesn't provide additional value.
Hey @bernsno, thanks for the comment. This feature will be included in our next minor release which is currently released on @beta-1.2.0
.