Repository: holoviz/panel

Issue:
DateRangeSlider raise TypeError: can't compare datetime.datetime to datetime.date
I'm on the latest branch of Panel.

The documentation states that `DateRangeSlider` supports `date`. I.e. I.e. would expect its `.from_param` method to support `CalendarDate` parameters. But it raises an exception when I try.

```python
import panel as pn
import param
from datetime import date

class Model(param.Parameterized):
    period = param.CalendarDateRange(default=(date(2022,1,1), date(2022,1,3)), bounds=(date(2022,1,1), date(2022,1,5)))

model = Model()

widget = pn.widgets.DateRangeSlider.from_param(model.param.period)

pn.Column(
    widget, # pn.bind(out, model.param.period)
).servable()
```

When you drag the right slider the below is raised.

```bash
  File "/home/jovyan/repos/private/panel/.venv/lib/python3.10/site-packages/param/parameterized.py", line 2282, in update
    restore = self_._update(*args, **kwargs)
  File "/home/jovyan/repos/private/panel/.venv/lib/python3.10/site-packages/param/parameterized.py", line 2322, in _update
    self_._batch_call_watchers()
  File "/home/jovyan/repos/private/panel/.venv/lib/python3.10/site-packages/param/parameterized.py", line 2506, in _batch_call_watchers
    self_._execute_watcher(watcher, events)
  File "/home/jovyan/repos/private/panel/.venv/lib/python3.10/site-packages/param/parameterized.py", line 2468, in _execute_watcher
    watcher.fn(*args, **kwargs)
  File "/home/jovyan/repos/private/panel/panel/param.py", line 513, in link_widget
    self.object.param.update(**{p_name: change.new})
  File "/home/jovyan/repos/private/panel/.venv/lib/python3.10/site-packages/param/parameterized.py", line 2282, in update
    restore = self_._update(*args, **kwargs)
  File "/home/jovyan/repos/private/panel/.venv/lib/python3.10/site-packages/param/parameterized.py", line 2315, in _update
    setattr(self_or_cls, k, v)
  File "/home/jovyan/repos/private/panel/.venv/lib/python3.10/site-packages/param/parameterized.py", line 525, in _f
    instance_param.__set__(obj, val)
  File "/home/jovyan/repos/private/panel/.venv/lib/python3.10/site-packages/param/parameterized.py", line 527, in _f
    return f(self, obj, val)
  File "/home/jovyan/repos/private/panel/.venv/lib/python3.10/site-packages/param/parameterized.py", line 1490, in __set__
    self._validate(val)
  File "/home/jovyan/repos/private/panel/.venv/lib/python3.10/site-packages/param/parameters.py", line 1274, in _validate
    self._validate_bounds(val, self.bounds, self.inclusive_bounds, 'bound')
  File "/home/jovyan/repos/private/panel/.venv/lib/python3.10/site-packages/param/parameters.py", line 1330, in _validate_bounds
    too_low = (vmin is not None) and (v < vmin if incmin else v <= vmin)
TypeError: can't compare datetime.datetime to datetime.date
```


Discussion:

Resolving patch:
diff --git a/panel/widgets/slider.py b/panel/widgets/slider.py
--- a/panel/widgets/slider.py
+++ b/panel/widgets/slider.py
@@ -743,10 +743,10 @@ def _process_property_change(self, msg):
         msg = super()._process_property_change(msg)
         if 'value' in msg:
             v1, v2 = msg['value']
-            msg['value'] = (value_as_datetime(v1), value_as_datetime(v2))
+            msg['value'] = (value_as_date(v1), value_as_date(v2))
         if 'value_throttled' in msg:
             v1, v2 = msg['value_throttled']
-            msg['value_throttled'] = (value_as_datetime(v1), value_as_datetime(v2))
+            msg['value_throttled'] = (value_as_date(v1), value_as_date(v2))
         return msg
 
 


Test patch:
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -20,7 +20,7 @@ jobs:
     name: Run pre-commit
     runs-on: 'ubuntu-latest'
     steps:
-      - uses: holoviz-dev/holoviz_tasks/pre-commit@v0.1a17
+      - uses: holoviz-dev/holoviz_tasks/pre-commit@v0.1a19
   unit_test_suite:
     name: Unit tests on ${{ matrix.os }} with Python ${{ matrix.python-version }}
     needs: [pre_commit]
@@ -48,7 +48,7 @@ jobs:
       PYCTDEV_SELF_CHANNEL: "pyviz/label/dev"
       OMP_NUM_THREADS: 1
     steps:
-      - uses: holoviz-dev/holoviz_tasks/install@v0.1a18
+      - uses: holoviz-dev/holoviz_tasks/install@v0.1a19
         with:
           name: unit_test_suite
           python-version: ${{ matrix.python-version }}
@@ -138,7 +138,7 @@ jobs:
       # it as one of the sources.
       PYCTDEV_SELF_CHANNEL: "pyviz/label/dev"
     steps:
-      - uses: holoviz-dev/holoviz_tasks/install@v0.1a18
+      - uses: holoviz-dev/holoviz_tasks/install@v0.1a19
         with:
           name: ui_test_suite
           python-version: 3.9
@@ -212,7 +212,7 @@ jobs:
       SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
     steps:
       # Add back when this works on Python 3.12
-      # - uses: holoviz-dev/holoviz_tasks/install@v0.1a18
+      # - uses: holoviz-dev/holoviz_tasks/install@v0.1a19
       #   with:
       #     name: core_test_suite
       #     python-version: ${{ matrix.python-version }}
@@ -229,7 +229,7 @@ jobs:
         run: git fetch --prune --tags --unshallow -f
       - uses: actions/setup-node@v3
         with:
-          node-version: 16.x
+          node-version: 18.x
       - uses: actions/setup-python@v4
         with:
           python-version: "3.12"
diff --git a/panel/tests/widgets/test_slider.py b/panel/tests/widgets/test_slider.py
--- a/panel/tests/widgets/test_slider.py
+++ b/panel/tests/widgets/test_slider.py
@@ -174,11 +174,11 @@ def test_date_range_slider(document, comm):
     widget.value = ((datetime(2018, 9, 3)-epoch).total_seconds()*1000,
                     (datetime(2018, 9, 6)-epoch).total_seconds()*1000)
     date_slider._process_events({'value': widget.value})
-    assert date_slider.value == (datetime(2018, 9, 3), datetime(2018, 9, 6))
+    assert date_slider.value == (date(2018, 9, 3), date(2018, 9, 6))
     value_throttled = ((datetime(2018, 9, 3)-epoch).total_seconds()*1000,
                     (datetime(2018, 9, 6)-epoch).total_seconds()*1000)
     date_slider._process_events({'value_throttled': value_throttled})
-    assert date_slider.value == (datetime(2018, 9, 3), datetime(2018, 9, 6))
+    assert date_slider.value == (date(2018, 9, 3), date(2018, 9, 6))
 
     date_slider.value = (datetime(2018, 9, 4), datetime(2018, 9, 6))
     assert widget.value == (1536019200000, 1536192000000)
@@ -194,7 +194,7 @@ def test_date_range_slider(document, comm):
         date_slider._process_events(
             {'value_throttled': epoch_times(datetime(2021, 2, 15), datetime(2021, 5, 15))}
         )
-        assert date_slider.value == (datetime(2021, 2, 15), datetime(2021, 5, 15))
+        assert date_slider.value == (date(2021, 2, 15), date(2021, 5, 15))
 
         date_slider.value = (datetime(2021, 2, 12), datetime(2021, 5, 12))
         assert widget.value == (1613088000000, 1620777600000)