monim67 / django-bootstrap-datepicker-plus

Bootstrap3/Bootstrap4/Bootstrap5 DatePickerInput, TimePickerInput, DateTimePickerInput, MonthPickerInput, YearPickerInput with date-range-picker functionality for django >= 2.0
https://pypi.python.org/pypi/django-bootstrap-datepicker-plus
MIT License
223 stars 61 forks source link

Date/time ranges (definable via `.start_of()`/`.end_of()`) cannot be linked to define more complex ranges #75

Open amyodov opened 2 years ago

amyodov commented 2 years ago

Describe the bug It seems that you can define multiple ranges by their start-end. But you cannot define the linked ranges, or the range with multiple intermediate point.

Example which I tried to do (and failed):

start = forms.DateTimeField(
    initial=datetime(year=2022, month=1, day=1),
    widget=DateTimePickerInput().start_of('precalc'))
mid = forms.DateTimeField(
    initial=datetime(year=2022, month=1, day=15),
    widget=DateTimePickerInput().end_of('precalc').start_of('calc'))
end = forms.DateTimeField(
    initial=datetime(year=2022, month=1, day=30),
    widget=DateTimePickerInput().end_of('calc'))

The point is to have start <= mid <= end

[x] I have followed the configuration instructions and checked out the common error troubleshooting page.