PanagiotisGeorgiadis / Elm-DatePicker

A DatePicker package created using Elm 0.19
https://package.elm-lang.org/packages/PanagiotisGeorgiadis/elm-datepicker/latest/
BSD 3-Clause "New" or "Revised" License
11 stars 2 forks source link

There is no way to select an "empty" date range #7

Open geertmulders opened 3 years ago

geertmulders commented 3 years ago

When selecting a date-range using the DateRangePicker it is impossible to select a range that starts and ends on the same date.

In our use case we want to view data on a specific range, where it makes perfect sense to view data only for one day.

PanagiotisGeorgiadis commented 3 years ago

Greetings @geertmulders and thanks a lot for raising this issue.

I believe that the current behavior of the DateRangePicker cannot accommodate single date selection because of a couple of reasons.

Could your problem be solved by using two different types of filters / inputs ( one that spawns a DatePicker for single date selection and another one that spawns a DateRangePicker for date range selection ) or by using different pages / views ?

I have no idea over what your project / scope is but in my personal experience, its easier to show users more data when they are querying for a singe date rather than a date, so my intuition would be to create a view where it has a DatePicker and shows more elaborate data and another one which uses a DateRangePicker but shows more like an overview of the data and navigates the user to the view mentioned above when they would like more details.

I hope I've been of help but feel free to contact me should you require any help or have any issues that I can help with.

Panos

geertmulders commented 3 years ago

Thanks @PanagiotisGeorgiadis for your answer.

I don't think this can be solved using a combination of a date-picker and a range-picker. The requirements for my project is to show a list of "data-items" and to filter them by their creation date on a range of dates. If the user wants to select items for one single day it must be possible to select the same end- and start-date. I don't want to bother the user with different types of inputs. Besides this, semantically it is a truly different thing to select a single date or to select an empty range.