Skip to content

Commit

Permalink
Use DatetimeRangeSlider for param.DateRange mapping (#3549)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed May 23, 2022
1 parent c6f728f commit 0dab3ba
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions panel/param.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from collections import OrderedDict, defaultdict, namedtuple
from contextlib import contextmanager
from functools import partial
from packaging.version import Version

import param

Expand All @@ -21,17 +22,18 @@
from .layout import Column, Panel, Row, Spacer, Tabs
from .pane.base import PaneBase, ReplacementPane
from .util import (
abbreviated_repr, classproperty, full_groupby, fullpath, get_method_owner,
is_parameterized, param_name, recursive_parameterized
abbreviated_repr, bokeh_version, classproperty, full_groupby,
fullpath, get_method_owner, is_parameterized, param_name,
recursive_parameterized
)
from .reactive import Reactive
from .viewable import Layoutable, Viewable
from .widgets import (
ArrayInput, Button, Checkbox, ColorPicker, DataFrame, DatePicker,
DatetimeInput, DateRangeSlider, DiscreteSlider, FileSelector,
FloatSlider, IntInput, IntSlider, LiteralInput, MultiSelect,
RangeSlider, Select, FloatInput, StaticText, TextInput, Toggle,
Widget
DatetimeInput, DatetimeRangeSlider, DateRangeSlider,
DiscreteSlider, FileSelector, FloatSlider, IntInput, IntSlider,
LiteralInput, MultiSelect, RangeSlider, Select, FloatInput,
StaticText, TextInput, Toggle, Widget
)
from .widgets.button import _ButtonBase

Expand Down Expand Up @@ -178,6 +180,9 @@ class Param(PaneBase):
if hasattr(param, 'Event'):
mapping[param.Event] = Button

if bokeh_version >= Version('2.4.3'):
mapping[param.DateRange] = DatetimeRangeSlider

priority = 0.1

_unpack = True
Expand Down

0 comments on commit 0dab3ba

Please sign in to comment.