django datepicker mindate and maxdate

Solutions on MaxInterview for django datepicker mindate and maxdate by the best coders in the world

showing results for - "django datepicker mindate and maxdate"
Tommaso
20 Jan 2016
1from django import forms
2from .models import Booking
3
4import datetime
5
6
7class BookingForm(forms.ModelForm):
8    class Meta:
9        model = Booking
10        fields = ('booking_name', 'rental_price',
11                'book_car', 'customer_name', 'times_pick',)
12        widgets = {
13            'times_pick': DateTimePickerInput(
14                options={
15                    'minDate': (datetime.datetime.today() + datetime.timedelta(days=1)).strftime('%Y-%m-%d 00:00:00'),
16                    'maxDate': (datetime.datetime.today() + datetime.timedelta(days=2)).strftime('%Y-%m-%d 23:59:59'),
17                    'enabledHours': [8, 9, 10, 11, 12, 13, 14, 15, 16, 17],
18                }
19            ),
20        }
21
similar questions
queries leading to this page
django datepicker mindate and maxdate