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 63 forks source link

how to customize... #52

Open pch783 opened 4 years ago

pch783 commented 4 years ago

hello I would like to know how to disable holidays (like Christmas or New Years). And restrict the minutes to 00 and 30. Example: 12.00 12.30

Thank u!

class Form(forms.ModelForm):

class Meta:
    model = Reserva
    fields = ["end_date", "start_time", "comensales"]
    widgets = {
        'comensales' : forms.NumberInput(
            attrs={
                'class': 'form-control',
            }
        ),
        'end_date': DatePickerInput(
            format='%d/%m/%Y',
            options={
                "locale": "es", 
            }
        )
        'start_time': TimePickerInput(
            options={
                'enabledHours': [12, 13, 14, 19, 20 , 21, 22]
            }
        ),
    }
kesslmar commented 1 year ago

I would be interested in the restriction of the minutes as well. And is there any way to hide the disabled hours?

Edit: Where would one find the complete list of options? The documentation is referencing to a code snipped but it seems to be incomplete, as for instance 'enabledHours' is not mentioned there.

Thank you!

Mirateo commented 3 weeks ago

I'm still looking for answer. @kesslmar, @pch783 were you able to find any?