panel icon indicating copy to clipboard operation
panel copied to clipboard

Hide time in DatetimeRangePicker widget if enable_time is false?

Open TheoMathurin opened this issue 3 years ago • 3 comments

The DatetimeRangePicker widget can be used as a date range picker if enable_time is False.

In this case it may be better to change the string format in the value field so that instead of the full datetime, you would simply see "2022-01-01 to 2022-01-02" as the time is not relevant in this context. It can also be confusing to display the time while it cannot be changed in the browser.

image

TheoMathurin avatar Aug 29 '22 10:08 TheoMathurin

Sorry I did not know there was an open PR for a DateRangePicker. This issue may therefore be ignored.

If a dedicated date range picker widget exists, the "enable_time" option in DatetimeRangePicker could become obsolete.

TheoMathurin avatar Aug 29 '22 11:08 TheoMathurin

I will close this issue when #2804 is merged. If it's decided that it's not the way to go, there could be a discussion on how to make DatetimeRangePicker more suitable for picking dates.

TheoMathurin avatar Sep 09 '22 08:09 TheoMathurin

I think it would indeed be nicer to have a DateRangePicker widget, to complete the series of the date/time widgets which makes them more easily discoverable.

maximlt avatar Sep 09 '22 08:09 maximlt

But still it would be nice to be able to control the formatting. The underlying Bokeh model has the format property. Panel has not implemented that.

MarcSkovMadsen avatar Nov 10 '23 05:11 MarcSkovMadsen

I want to implement Bokeh's implementation of DatetimePicker, DatePicker, DatetimeRange, and DateRangePicker. Panel's current DatetimePicker and DatetimeRangePicker were implemented before Bokeh's current implementation and are based on an old version of DatePicker + some updates to work with Bokeh 3.

I haven't done it because of point 2 of https://github.com/bokeh/bokeh/issues/12904, where local timezones affect the start and end times.

hoxbro avatar Nov 10 '23 08:11 hoxbro

@MarcSkovMadsen Is there any workaround to hide time part before things improved/fixed?

cosmicfarmers avatar Nov 14 '23 01:11 cosmicfarmers

Maybe enable_time could be removed from _DatetimePickerBase and this issue will be closed.

In fact I don't know what is the benefit from having enable_time = False in DatetimePicker. And now that DateRangePicker is coming, I'm struggling to think of a situation where it will be useful for DatetimeRangePicker either.

TheoMathurin avatar Dec 14 '23 13:12 TheoMathurin