h2oai / wave

Realtime Web Apps and Dashboards for Python and R
https://wave.h2o.ai
Apache License 2.0
3.9k stars 327 forks source link

Datetime picker #2000

Open aranvir opened 1 year ago

aranvir commented 1 year ago

Is your feature request related to a problem? Please describe

I'd like users to specify a time range by defining two datetimes. The beginning of the time range cannot lie in the past and the end (obviously) must be later than the beginning. Currently, if a minimum time for the time picker is specified this limits the time for all days even those in the future that would specify a valid end time.

Describe the solution you'd like

Currently, separate date and time pickers are available. A combined datetime picker has been suggested before here: https://github.com/h2oai/wave/issues/1537. My motivation for the request is different then for that issue which is why I created a new one.

I'd like either a combined datetime picker that takes a min and max limit as datetime. Alternatively, my problem would be solved if the time picker takes a datetime or timestamp as limit (but that does not seem like a good solution).

Describe alternatives you've considered

The alternative for my use case would be to remove min/max limiters and add a validation step that prevents form submission for invalid start/stop inputs. But UI limitation would be easier to use.

Additional context

None

mturoci commented 1 year ago

Is your feature request the same as https://github.com/h2oai/wave/issues/1012?

aranvir commented 1 year ago

I would also need time specification, not just date range

mturoci commented 1 year ago

I see. Can you point to some real-world web apps that would use such range picker that supports both dates and times? IIRC, I have always only saw date range pickers and the time was then picked separately.

aranvir commented 1 year ago

I don't have an example. I kind of thought I had seen something like this on booking pages for trains and flights but if I look for it now it is indeed separate pickers.

I did not think it was such a niche use case :sweat_smile: but maybe it is.

Anyway, I thought I'd request it as a nice-to-have and maybe it would be also useful for others. For now, I "solved" it for my use-case by adding the validation step.

mturoci commented 1 year ago

Gotcha, sounds reasonable. Will leave this open for now. Since the component would be fairly complex, I will backseat it for now, but happy to accept community PRs in case of interest.