diff --git a/examples/reference/widgets/TimePicker.ipynb b/examples/reference/widgets/TimePicker.ipynb index 4938842c8a..e8be1ad923 100644 --- a/examples/reference/widgets/TimePicker.ipynb +++ b/examples/reference/widgets/TimePicker.ipynb @@ -30,6 +30,12 @@ "* **``start``** (str | datetime.time): Inclusive lower bound of the allowed time selection\n", "* **``end``** (str | datetime.time): Inclusive upper bound of the allowed time selection\n", "\n", + "##### Display\n", + "\n", + "* **``disabled``** (boolean): Whether the widget is editable\n", + "* **``name``** (str): The title of the widget\n", + "* **``format``** (str): Formatting specification for the display of the picked date.\n", + "\n", " ```\n", " +---+------------------------------------+------------+\n", " | H | Hours (24 hours) | 00 to 23 |\n", @@ -44,17 +50,11 @@ " See also https://flatpickr.js.org/formatting/#date-formatting-tokens.\n", "\n", "\n", - "\n", - "##### Display\n", - "\n", - "* **``disabled``** (boolean): Whether the widget is editable\n", - "* **``name``** (str): The title of the widget\n", - "* **``format``** (str): Formatting specification for the display of the picked date.\n", "* **``hour_increment``** (int): Defines the granularity of hour value increments in the UI. Default is 1.\n", "* **``minute_increment``** (int): Defines the granularity of minute value increments in the UI. Default is 1.\n", "* **``second_increment``** (int): Defines the granularity of second value increments in the UI. Default is 1.\n", "* **``seconds``** (bool): Allows to select seconds. By default, only hours and minutes are selectable, and AM/PM depending on the `clock` option. Default is False.\n", - "* **``clock``** (bool): Whether to use 12 hour or 24 hour clock.\n", + "* **``clock``** (str): Whether to use 12 hour or 24 hour clock. Default is `'12h'`.\n", "___" ] }, diff --git a/panel/widgets/input.py b/panel/widgets/input.py index b088a3dfa9..bcf884579a 100644 --- a/panel/widgets/input.py +++ b/panel/widgets/input.py @@ -813,15 +813,15 @@ def _deserialize_value(self, value): class _TimeCommon(Widget): - hour_increment = param.Integer(default=1, doc=""" + hour_increment = param.Integer(default=1, bounds=(1, None), doc=""" Defines the granularity of hour value increments in the UI. """) - minute_increment = param.Integer(default=1, doc=""" + minute_increment = param.Integer(default=1, bounds=(1, None), doc=""" Defines the granularity of minute value increments in the UI. """) - second_increment = param.Integer(default=1, doc=""" + second_increment = param.Integer(default=1, bounds=(1, None), doc=""" Defines the granularity of second value increments in the UI. """) @@ -830,7 +830,7 @@ class _TimeCommon(Widget): selectable, and AM/PM depending on the `clock` option. """) - clock = param.String(default='12h', doc=""" + clock = param.Selector(default='12h', objects=['12h', '24h'], doc=""" Whether to use 12 hour or 24 hour clock.""") __abstract = True