File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -474,7 +474,8 @@ def update_date(
474474
475475 Note
476476 ----
477- You cannot update the value of a date input to `None` or an empty string.
477+ A special value of `""` (an empty string) can be used to clear the value, min, and
478+ max.
478479
479480 See Also
480481 --------
@@ -489,7 +490,19 @@ def update_date(
489490 "min" : _as_date_attr (min ),
490491 "max" : _as_date_attr (max ),
491492 }
492- session .send_input_message (id , drop_none (msg ))
493+
494+ msg = drop_none (msg )
495+
496+ # Handle the special case of "", which means the value should be cleared
497+ # (i.e., go from a specified date to no specified date)
498+ if value == "" :
499+ msg ["value" ] = None
500+ if min == "" :
501+ msg ["min" ] = None
502+ if max == "" :
503+ msg ["max" ] = None
504+
505+ session .send_input_message (id , msg )
493506
494507
495508@add_example ()
You can’t perform that action at this time.
0 commit comments