-
-
Notifications
You must be signed in to change notification settings - Fork 517
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
Improve date and datetime picker functionality #6152
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #6152 +/- ##
========================================
Coverage 84.69% 84.70%
========================================
Files 296 296
Lines 44184 44294 +110
========================================
+ Hits 37423 37520 +97
- Misses 6761 6774 +13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
panel/models/datetime_picker.py
Outdated
@@ -10,7 +10,7 @@ class DatetimePicker(InputWidget): | |||
|
|||
''' | |||
|
|||
value = Nullable(String, help=""" | |||
value = Nullable(Either(String, Date, Datetime), help=""" |
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.
Is this really needed or correct? What does bokeh convert the Date, Datetime values to?
panel/widgets/input.py
Outdated
options = list(params.pop('options')) | ||
params['enabled_dates'] = options | ||
if 'value' in params and hasattr(params['value'], "astype"): | ||
value = ( |
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.
Would prefer not to repeat this logic multiple times. Would pull this out as a utility maybe?
Actually I think there's an issue with the link between panel -> holoviews, and I'm not sure how to address: Initially, the value is a np.datetime64 When a value is selected, it reverts back to Which I think is the root of a blank plot: CC: @rsignell |
Would it be acceptable to have a as_numpy_datetime64 param? Screen.Recording.2024-01-09.at.1.46.32.PM.mov |
Some bug fixes (start/end were not applied if datetime64) and makes the following work:
Closes #6143