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
DateRangePicker Singe Date Selection Issues #47
Comments
Hi @bigmike36c, Thanks for reporting this issue. I agree with your comment about the behaviour and I have corrected that (will be released in 0.6.0). |
Thanks for correcting this so quickly! In my mind, if a user only selects a single date, then the user expects the date range to extend from the start date to the maximum date available. The code snippet below is essentially how I've been handling this with the default dcc.DatePickerRange. If the callback is triggered with only one date selected (either start or end), the other date is simply set to an empty string in the callback. I then convert the empty string to the minimum or maximum date in the dataframe.
Since the dmc.DateRangePicker only lets you select the start date on its own, I think it would make the most sense for the callback to receive ["selected_start_date", maxDate]. If the maxDate parameter was not set, it could be replaced with an empty string or None. |
Okay got it.
It makes the date range picker less intuitive as to what's in the value is not what's displayed, etc. |
Makes sense to me. Could the callback just trigger with |
Ability to select single date won't be supported in dmc.DateRangePicker, for such purposes please use two date pickers. |
Hello,
Really appreciate your work on this awesome project!
I'm having issues selecting a single date with the daterangepicker. The first issue is with the UI as shown below. When trying to select a single date the first time, the selection simply disappears. However, the second time I select a single date, it stays.
Screen.Recording.2022-02-25.at.8.16.47.PM.mov
The second issue is triggering a callback with a single date selection. Can this be done? I was hoping the callback value would be something along the lines of ["selected_start_date", maxDate], but a single selection does not appear to trigger the callback.
Thanks in advance for any help.
The text was updated successfully, but these errors were encountered: