Skip to content
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

Add TimePicker from Bokeh #7013

Merged
merged 9 commits into from
Aug 26, 2024
Merged

Add TimePicker from Bokeh #7013

merged 9 commits into from
Aug 26, 2024

Conversation

ahuang11
Copy link
Contributor

Adds TimePicker

image

The times mismatch due to timezone:
bokeh/bokeh#13768

@ahuang11 ahuang11 requested a review from philippjfr July 25, 2024 16:51
Copy link

codecov bot commented Jul 25, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 16 lines in your changes missing coverage. Please review.

Project coverage is 82.18%. Comparing base (3b0d8c2) to head (a8a62e2).
Report is 9 commits behind head on main.

Files Patch % Lines
panel/tests/ui/widgets/test_time_picker.py 51.51% 16 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7013      +/-   ##
==========================================
+ Coverage   82.17%   82.18%   +0.01%     
==========================================
  Files         328      330       +2     
  Lines       49206    49268      +62     
==========================================
+ Hits        40434    40493      +59     
- Misses       8772     8775       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ahuang11
Copy link
Contributor Author

ahuang11 commented Aug 5, 2024

I tried correcting the timezone by adding back the difference, but I keep getting assertion error and I have no idea why. I thought it was the type initially, but whatever I change it to, number/string, it still crashes.

image

panel/models/time_picker.ts Outdated Show resolved Hide resolved
panel/models/time_picker.ts Outdated Show resolved Hide resolved
@ahuang11
Copy link
Contributor Author

ahuang11 commented Aug 6, 2024

Okay I think it's ready

import panel as pn
import datetime

pn.extension()

def change(event):
    time_picker.value = datetime.time(hour=4, minute=8)

def print_picker(value):
    print(value)

time_picker = pn.widgets.TimePicker(value=datetime.time(hour=18, minute=8), format="H:i")
pn.bind(print_picker, time_picker, watch=True)
button = pn.widgets.Button(name='Change Time', on_click=change)
pn.Row(time_picker, button).servable()
Screen.Recording.2024-08-06.at.2.34.43.PM.mov

@philippjfr
Copy link
Member

Maybe worth adding a test for a different timezone: microsoft/playwright#26996

@ahuang11 ahuang11 added this to the v1.5.0 milestone Aug 23, 2024
@philippjfr philippjfr merged commit 577f8d9 into main Aug 26, 2024
15 of 16 checks passed
@philippjfr philippjfr deleted the add_time_picker branch August 26, 2024 12:57
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.

4 participants