holoviz-topics / EarthSim

Tools for working with and visualizing environmental simulations.
https://earthsim.holoviz.org
BSD 3-Clause "New" or "Revised" License
65 stars 21 forks source link

Date Picker is not editable in Panel #216

Closed Kniles77 closed 5 years ago

Kniles77 commented 6 years ago

Panels date-picker is behaving similar to the number issue raised earlier.

screen shot 2018-09-06 at 10 56 06 am

kcpevey commented 6 years ago

i.e. the date picker widget inside of Panel is not showing up as editable (well, the widget doesn't show up at all as you can see above).

kcpevey commented 5 years ago

It is now not constant, but its visualized as a text box/string. Was that the goal?
date

It is still not editable (the top widget shows how it says (invalid) upon editing. Related: https://github.com/pyviz/panel/issues/34

philippjfr commented 5 years ago

This is indeed a bug, what would you find more useful, should it switch back to a DatePicker or should I fix the text box to parse the dates correctly?

kcpevey commented 5 years ago

Somewhere (either in an issue or the phone) we were discussing the fact that param.Date holds a datetime object which does contain both a date AND a time, but the DatePicker only exposes the date. My current workaround is to present param.Date for just the date information and an additional param.String to input a formatted timestamp.

I think I like the format that it displays in now (a text editable timestamp) since it contains all of the information available in datetime and reduces the number of widgets I have. That said, I'd prefer control over the displayed format. And then of course there's also the issue of where format-checking on the input sits.

philippjfr commented 5 years ago

Panel allows us to write widgets that would let you specify the format and do the input validation, so I'd be happy to implement that for param.Date. You'd have to override the format globally like so for now:

panel.widgets.DatetimeInput.format = '%Y-%m-%d %H:%M:%S'

However we could consider adding a way to customize the configuration somehow, that might look something like this:

panel.Pane(parameterized.param, widget_config={'date_parameter': {'format': ...}})
philippjfr commented 5 years ago

The DatetimeInput widget was merged in https://github.com/pyviz/panel/pull/58

sdc50 commented 5 years ago

I don't know how much work this would entail, but I think it would be nice to have a date/time picker widget similar to this: https://eonasdan.github.io/bootstrap-datetimepicker/

kcpevey commented 5 years ago

What we have is working now. I like the bootstrap version @sdc50 mentioned, but I think we'll consider that as a future enhancement.