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

Clearing value of a DatetimePicker #3975

Closed
thuydotm opened this issue Oct 10, 2022 · 0 comments · Fixed by #3990
Closed

Clearing value of a DatetimePicker #3975

thuydotm opened this issue Oct 10, 2022 · 0 comments · Fixed by #3990

Comments

@thuydotm
Copy link
Collaborator

thuydotm commented Oct 10, 2022

Description of expected behavior and the observed behavior

Not sure if this is a bug or a new feature to Panel. Let's say I have a layout consisting of a button named "Edit", a DatetimePicker disabled with no default value, and a button named "Submit". At the time of initialization, the value of DatetimePicker is Null. The way these objects interact is as follows:

  • Click "Edit" button, DatetimePicker is enabled so user can select a specific time value.
  • Click "Submit" button, the selected time value will be pushed to the DB, and the DatetimePicker will be disabled and reset back to Null.

I have tried several ways with no success in clearing the value of the DatetimePicker.

Complete, minimal, self-contained example code that reproduces the issue

time_widget = pn.widgets.DatetimePicker(disabled=True)
time_widget.value = now()

# how to set value back to None?
time_widget.value = None/pandas.NaT/np.nan => all causes error
@thuydotm thuydotm changed the title Clear value of a DatetimePicker Clearing value of a DatetimePicker Oct 10, 2022
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 a pull request may close this issue.

1 participant