panel
panel copied to clipboard
Daterangepicker
I added a DateRangePicker widget, for when you only want a datetime.date range rather than a datetime.datetime range.
@samuelyeewl Do you still want to add this? I think it's reasonable to add although we might consider making DatetimerRangePicker
more configurable.
Yes, I think it would be useful to have a widget that returns a datetime.date rather than datetime.datetime object (DatetimeRangePicker already has a disable_time parameter, but still returns a datetime with time = 12:00, which can lead to inconsistencies). I had to fix a bug in the tests and added the reference notebook. However, I think the DateRangePicker needs a little more work as it shows some of the layout parameters from the DatetimeRangePicker (which I subclassed) that are no longer relevant (enable_seconds, military_time). Any thoughts on how to do this?
I haven't looked at the details here, but if you are trying to make a parameter not appear and not be used in a subclass, you can redefine it with the same type but a negative precedence and readonly=True (e.g. x=param.Integer(0, precedence=-1, readonly=True)
.
I haven't looked at the details here, but if you are trying to make a parameter not appear and not be used in a subclass
That seems like a weird approach honestly, you should instead create a baseclass that has the parameters you do want to be shared and then subclass from that.
Or in this case it might be reasonable to invert the hierarchy and have DatetimeRangePicker inherit from your DateRangePicker.
That seems like a weird approach honestly, you should instead create a baseclass that has the parameters you do want to be shared and then subclass from that.
Good point; that's the right long-term approach. My answer only applies if you are unwilling or unable to do a refactor like that.
I need this to to support param.DateRange
parameters.
Closes #5844
Superseded by https://github.com/holoviz/panel/pull/6027