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 1 year 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