Skip to content

Commit

Permalink
input_date()'s input handler now handles None more gracefully (#1556
Browse files Browse the repository at this point in the history
)

Co-authored-by: Barret Schloerke <[email protected]>
  • Loading branch information
cpsievert and schloerke authored Jul 25, 2024
1 parent dc0b294 commit 2caa64c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Bug fixes

* An empty `input_date()` value no longer crashes Shiny. (#1528)

* Fixed bug where calling `.update_filter(None)` on a data frame renderer did not visually reset non-numeric column filters. (It did reset the column's filtering, just not the label). Now it resets filter's label. (#1557)

* Require shinyswatch >= 0.7.0 and updated examples accordingly. (#1558)
Expand Down
4 changes: 2 additions & 2 deletions shiny/input_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ def _(value, name, session):

@input_handlers.add("shiny.date")
def _(
value: str | list[str], name: ResolvedId, session: Session
value: str | list[str] | None, name: ResolvedId, session: Session
) -> date | None | tuple[date | None, date | None]:

if isinstance(value, str):
if isinstance(value, str) or value is None:
return _safe_strptime_date(value)
else:
return (
Expand Down

0 comments on commit 2caa64c

Please sign in to comment.